createPulse
Creates one reactive value and returns `read()`, `write(...)` and `runSubscribers()`.
Table of contents
Category
Value
Import
jsimport { createPulse } from "valyrian.js/pulses";Public signature
ts<T>(initialValue: T): [read: () => T, write: (newValue: T | ((current: T) => T)) => void, runSubscribers: () => void]Parameters
tsinitialValue: TResult
ts[read: () => T, write: (newValue: T | ((current: T) => T)) => void, runSubscribers: () => void]Observable effects
`write(...)` notifies after a value change. `runSubscribers()` runs current subscribers without changing the value.