Created
August 28, 2017 07:59
-
-
Save Bizunow/9d5d829ef485f22316d0947bbd4078b4 to your computer and use it in GitHub Desktop.
[ES6 Module-singleton] #js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _data = []; | |
const UserStore = { | |
add: item => _data.push(item), | |
get: id => _data.find(d => d.id === id) | |
} | |
Object.freeze(UserStore); | |
export default UserStore; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment