marionette.component
marionette.component copied to clipboard
Data sent to view can be customized.
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.
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
overviewData
. - 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!
Everything done, I hope, in the right way.
@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!
Finally :)) I hope this time is fine.
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!
Squashed :)