redux-immutable-persistence-transform
Version:
Library that allows you to transform immutable data created with seamless-immutable for use with redux-persist
16 lines (10 loc) • 361 B
JavaScript
import R from "ramda";
import Immutable from "seamless-immutable";
const isImmutable = R.has("asMutable");
const convertToJs = state => state.asMutable({ deep: true });
const fromImmutable = R.when(isImmutable, convertToJs);
const toImmutable = raw => Immutable(raw);
export default {
out: state => toImmutable(state),
in: raw => fromImmutable(raw)
};