mediasuitenz / tech-stack

Media Suite's evolving tech stack
6 stars 0 forks source link

add wrap model hook return #5

Closed anotheredward closed 8 years ago

anotheredward commented 8 years ago

This may be controversial and I am happy not having it added in :).

I've recently had to modify a number of model hooks that exposed a single value and found the transition needlessly painful when all values could have been wrapped in an object up front, made the templates clearer, and the model easier to modify in the future.

The downside I can see here is that automagically generated model hooks that take advantage of dynamic route segments will not work like this.

ebuckley commented 8 years ago

I'm a fan of this :+1:

anotheredward commented 8 years ago

The only exception to this I can think of is the single-model, dynamic route, auto-magically generated routes.

anotheredward commented 8 years ago

@matt-in-a-hat Doesn't see the gain in wrapping a single value, but if we don't wrap single values we lose the benefit of it being easy to add new models in future without breaking route template.

Hmm, not sure on this one.