metafizzy / outlayer

:construction_worker: the brains & guts of a layout library
163 stars 63 forks source link

Feature: chaining #53

Closed marcobiedermann closed 6 years ago

marcobiedermann commented 6 years ago

return this on methods to allow chaining:

masonry.layout()
  .reloadItems();

I know the example above could be accomplished by using .appended() but there might be some useful cases for chaining.

desandro commented 6 years ago

Hello! Thanks for this suggestion.

Actually, I'm not a fan of chaining for most of my libraries. It makes sense when you're making multiple manipulations on a string or an array. But you're not often triggering multiple methods in succession, or least, you shouldn't be. I appreciate your input but I'll have to pass on this one.

marcobiedermann commented 6 years ago

@desandro Alright, thank you David for your opinion and explanation.