tymondesigns / angular-locker

🗄️ A simple & configurable abstraction for local/session storage in angular js projects
https://npm.im/angular-locker
MIT License
314 stars 42 forks source link

Add current value parameter function to put #10

Closed admwx7 closed 9 years ago

admwx7 commented 9 years ago

When passing a function to put, the function will now be called with the currently stored value for the put. This allows for easily updating values that are stored and depend on the old value, such as adding an item to an array stored in the locker without having to do a get then a put.

Also added in a default parameter option that can be passed, similar to how get works.

tymondesigns commented 9 years ago

this looks great @admwx7. would you be able to squash your commits, and I will merge?

Thanks

admwx7 commented 9 years ago

Ha, can't get my rebase to actually squash everything like it should, it just flags more in the commit history. I went through and did a rebase -i, removed all of your commits, set s for all of mine (removed 2 actually) then set r and updated the commit message for one of the commits. What am I doing wrong?

EDIT: For completeness, I then followed up that command with a merge from your repo to preserve your commits, and as resetting the head requires it, a merge from my own master in order to push my changes.

tymondesigns commented 9 years ago

Assuming you have an upstream/master that points to my repo? Then you would do git rebase -i upstream/master and you should only see your commits and not mine.

admwx7 commented 9 years ago

Yeah...now I remember why I hate git rebase. Should be good to go though, want me to make a new PR for it to clean things up?

tymondesigns commented 9 years ago

Yea rebase can be PITA sometimes!

It'll be good to merge for me once Travis has finished.

Thanks for that!

admwx7 commented 9 years ago

This code was removed, why? I'm currently in need of this functionality, and it had no compatibility issues with passing tests.

EDIT: Let me clarify, the default functionality associated with this was removed.