UNPKG

react-localstorage-hooks

Version:

A collection of React hooks for reactively managing localStorage

3 lines (2 loc) 214 B
export var deserialize = function (data) { return data === 'undefined' ? undefined : JSON.parse(data); }; export var serialize = function (data) { return data === undefined ? 'undefined' : JSON.stringify(data); };