Skip to main content

StateValueOrUpdater

type

A type alias to make it easier to define setter methods on your node class

type StateValueOrUpdater<Cfg extends AnyStateConfig> = ValueOrUpdater<StateConfigValue<Cfg>>

Import

import { StateValueOrUpdater } from '@modular/sdk/editor';

Notes

example
```ts const fooState = createState("foo", { parse: ... }); class MyClass extends TextNode { // ... setFoo(valueOrUpdater: StateValueOrUpdater<typeof fooState>): this { return $setState(this, fooState, valueOrUpdater); } } ```