Skip to content

Pick which state should be stored in AsyncStorage? #2266

Closed Answered by midrizi
midrizi asked this question in Q&A
Discussion options

You must be logged in to vote

I solved this by using lodash/pick function.

Doing the following in setupRootStore:

import pick from 'lodash/pick'

_dipsoser = onSnapshot(rootStore, (snapshot) => {
  return storage.save(ROOT_STATE_STORAGE_KEY, pick(snapshot, ['episodeStore.favoritesOnly']))
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wiktorkaplan
Comment options

Answer selected by midrizi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants