API Reference
The functions that Mutative exports, with their options, results and errors.
create()
Produce the next state from the changes that a recipe makes to a draft of the base state.
apply()
Apply patches to a state and get the next state, or change the state in place.
makeCreator()
Make a create() function with default options.
current()
Take a snapshot of the current value of a draft, as plain objects without proxies.
original()
Get the value that a draft was created from, without the changes of the recipe.
rawReturn()
Return a value from a recipe as it is, without searching it for drafts, or return undefined.
unsafe()
Read values that are not drafted in strict mode.
isDraftable()
Check whether Mutative drafts a value, optionally with a mark.
isDraft()
Check whether a value is a draft.
markSimpleObject()
A mark that drafts objects without a prototype and plain objects of other realms.
Type casts
castDraft(), castImmutable() and castMutable() change the TypeScript type of a value, and return the value as it is.
Edit on GitHub
Last updated on by unadlib