marionette.component icon indicating copy to clipboard operation
marionette.component copied to clipboard

Data sent to view can be customized.

Open devel-pa opened this issue 10 years ago • 6 comments

Hi, This is part of the change I think could be useful. The other part is to be able to set the data after initialization, but not found, yet, a reasonable implementation. Paul

PS1: maybe would be interesting just to pass the options, but I'm not convinced.

devel-pa avatar Feb 11 '15 08:02 devel-pa

Hi, @devel-pa. Thanks for PRing this feature up. I have a few remarks:

  • To keep this inline with Marionette classes' various options, I would like to support this as both an object literal and a function. Achieving this internally with _.result should be fine.
  • There'll need to be a few tests to test the behavior for when it's an object literal, when it's a function, and when it's not even defined. We shouldn't need a default defined on the base component class either.
  • I would prefer to call this viewOptions over viewData.
  • Don't worry about updating the dist file, I'll take care of that with the next release.

If something doesn't make sense or if you need any help, please let me know. Thanks again for the PR!

jfairbank avatar Feb 13 '15 02:02 jfairbank

Everything done, I hope, in the right way.

devel-pa avatar Feb 16 '15 08:02 devel-pa

@devel-pa Thanks for the changes. I added some comments, so we can tighten up the tests a little. This is looking good, thanks for the work so far!

jfairbank avatar Feb 20 '15 15:02 jfairbank

Finally :)) I hope this time is fine.

devel-pa avatar Mar 16 '15 11:03 devel-pa

Hey, @devel-pa. This looks good. Can you remove the changes to the dist files and squash the commits into one?

Thanks for your work and patience!

jfairbank avatar Apr 01 '15 23:04 jfairbank

Squashed :)

devel-pa avatar Apr 11 '15 23:04 devel-pa