UNPKG

666 BPlain TextView Raw
1// Should be no imports here!
2
3/**
4 * The sentinel value returned by producers to replace the draft with undefined.
5 */
6export const NOTHING: unique symbol = Symbol.for("immer-nothing")
7
8/**
9 * To let Immer treat your class instances as plain immutable objects
10 * (albeit with a custom prototype), you must define either an instance property
11 * or a static property on each of your custom classes.
12 *
13 * Otherwise, your class instance will never be drafted, which means it won't be
14 * safe to mutate in a produce callback.
15 */
16export const DRAFTABLE: unique symbol = Symbol.for("immer-draftable")
17
18export const DRAFT_STATE: unique symbol = Symbol.for("immer-state")