Use custom revivers and replacers for complex types
masterTo handle rich objects like Date, Map, or Set, you can use reviver and replacer functions.
- Revivers: Passed as the
altparameter to retrieval functions (get,getAll,remove,transact). They receive each key and value (including nested ones) to parse the string. - Replacers: Passed as the
overwriteparameter to setter functions (set,setAll,add,transact). They receive each key and value to stringify the data.
Global Configuration:
- Set
store._.reviveto handle all retrieval calls globally. - Set
store._.replaceto handle all setter calls globally.