jasonmerino / react-native-simple-store

A minimalistic wrapper around React Native's AsyncStorage.

Home Page:https://www.npmjs.com/package/react-native-simple-store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

updating an object of objects creates duplicate keys

sweetcoco opened this issue · comments

lets say the store has "favoriteAlbums"

favoriteAlbums: {
    a: {...},
    b: {...} 
}

Paradoxically, if you do this, you'll end up with a duplicate key in your favoriteAlbums object:

store.update('favoriteAlbums', {b: {,,,}}

// so now favoriteAlbums looks like this
favoriteAlbums: {
    a: {...},
    b: {...},
    b: {,,,} 
}

Ideal functionality would be to overwrite the nested object.

uhh... nvm, i'm a huge idiot. It's not duplicating the keys.