A readonly implementation of the observable pattern. Frameworks and vanilla consumers use this to read state and subscribe to changes.
Synchronously returns the current value.
Subscribes to changes.
A callback that is invoked when the value changes.
An unsubscribe function to clean up the listener.
A readonly implementation of the observable pattern. Frameworks and vanilla consumers use this to read state and subscribe to changes.