mutative • Docs
mutative / rawReturn
rawReturn<
T
>(value
):T
Use rawReturn() to wrap the return value to skip the draft check and thus improve performance.
import { create, rawReturn } from '../index';
const baseState = { foo: { bar: 'str' }, arr: [] };
const state = create(
baseState,
(draft) => {
return rawReturn(baseState);
},
);
expect(state).toBe(baseState);
• T extends undefined
| object
• value: T
T