Version 2.10.0
Feature: sync with external stores in session/local storage:
This feature allows you to sync other stores which was stored in your session/local storage.
createStore({
yourDetail, // it's an object of your state { firstName: '', lastName: '' }
}, {
syncStores: { // you can sync with external store and transform the data
name: 'externalStoreName',
transform: (externalStore, currentStore) => {
return { ...externalStore, ...currentStore };
},
}
})
or
createStore({
yourDetail,
}, {
syncStores: {
externalStoreName: ['yourDetail']
}
})