Skip to main content
πŸŽ‰οΈ Mutative v1.0 is now out! πŸ₯³οΈ

markSimpleObject()

markSimpleObject() is a mark function that marks all objects as immutable.

Usage​

If you want to mark all objects as immutable(raw object, plain object without prototype chains or cross-iframe objects with same domain), you can use markSimpleObject().

const baseState ={
foo:{
bar:'str',
},
simpleObject: Object.create(null),
};

const state =create(
baseState,
(draft)=>{
draft.foo.bar ='new str';
draft.simpleObject.a ='a';
},
{
mark: markSimpleObject,
}
);

expect(state.simpleObject).not.toBe(baseState.simpleObject);

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /