Reputation: 33
Im building a Jquery form validation plugin. my concern is that my plugin does not return the object for chaining purpose. but rather it returns an array. the array is one of the two
So any suggestion please, if you think this is bad, because the plugin should return the object for chaining purpose. or if you think im doing this its all ok. thanks for your help in advance
Upvotes: 2
Views: 307
Reputation: 5628
Make your plugin require a callback as a parameter. Instead of returning your array, you can pass it to the callback. This will get the data out, but let you still return the object as well.
Upvotes: 1