title Type – Update

type Update<T = any> =
| T
| { $set: T }
| { $merge: Merge<T> }
| { $apply: (t: T) => T }
| { $patch: (t: T) => Update<T> }
| { $nop: any }
| { $delete: any }
| DeepUpdate<T>
| undefined

Mutation-as-value

  • An update is a DeepPartial<T>, i.e. recursive Partial<T>
  • Allows for deep Update<T>
  • With extra $ops
  • Apply functions with $apply or $patch

Source

packages / state / src / types.ts

Sections
Source  
menu
format_list_numbered