That feels a little too magical to me though.
you don't like magic? then you should not have chosen to make it a jquery plugin :P
it would be the jquery way to return collections
but there are some issues around that, because the methods might return values that have previously been expected as for example "true" or "false", should they now be in a collection that would break entire applications.
2 ways I could imagine doing it:
- always return a collection if there is more than 1 item to return (I prefer this way)
- only return a collection if a method returns it self (return this), this way it will not break anything, because calling further actions on the jquery collection will call them on the objects
but then again this is actually not a consequent design, for me as a coder that is new to entwine it makes no sense, why should calling a method on a collection only return the result of the first objects method call, this would confuse me and I would have a hard time getting along. It actually took myself quiet a while till I figure out it was entwine that broke my code
or we could pick one of this 2 ways and introduce a compatibility version / compatibility config