-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to write plugins (custom methods) for this? #59
Comments
Yeah, there is Adding a plugin function using the
Nonetheless, if you want the name "pull" or an "isUndef" function as plugins, i would write them something like this: (function(_) {
// create "pull" alias for remove
_.fn('pull', function(key) {
return this.remove(key);
};
// create fn to check for undefined values
_.fn('isUndef', function(key) {
return (typeof this.get(key) !== 'undefined');
};
})(window.store._); I'm going to leave this open, if you don't mind, as a reminder to add a little plugin documentation and update the doc for |
Alright, i updated the README to say that remove returns removed data and add a simple extension example. Thanks! |
Thanks for the info, you even went ahead and converted my code! |
Is there a way to write plugins (custom methods) for this? The Marcus Westin version did but I'm trying to switch to your store package.
I have this code in my plugin for Marcus' package and I want to move it over.
The text was updated successfully, but these errors were encountered: