Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 743 Bytes

rawReturn.md

File metadata and controls

42 lines (26 loc) · 743 Bytes

mutativeDocs


mutative / rawReturn

Function: rawReturn()

rawReturn<T>(value): T

Use rawReturn() to wrap the return value to skip the draft check and thus improve performance.

Example

import { create, rawReturn } from '../index';

const baseState = { foo: { bar: 'str' }, arr: [] };
const state = create(
  baseState,
  (draft) => {
    return rawReturn(baseState);
  },
);
expect(state).toBe(baseState);

Type Parameters

T extends undefined | object

Parameters

value: T

Returns

T

Defined in

rawReturn.ts:21