Skip to content

Instantly share code, notes, and snippets.

@JonathanZWhite
Created April 17, 2016 23:56
Show Gist options
  • Save JonathanZWhite/2df1886dc678bde8f9facea948c0dd82 to your computer and use it in GitHub Desktop.
Save JonathanZWhite/2df1886dc678bde8f9facea948c0dd82 to your computer and use it in GitHub Desktop.
let store = {
...
update: function(hash, data) {
if (!this._users[hash]) this._initializeUserState(hash)
console.log('๐ŸŒ‘ => PREVIOUS STATE')
console.log(this.getState(hash))
this._users[hash] = _.merge(this._users[hash], data)
console.log('๐ŸŒ• => NEXT STATE')
console.log(this.getState(hash))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment