Enhance value with plain and explicit reactive wrapper. Think of it as hook-style signals.
Legacy versions: v5
Object.defineProperty
nor Proxy
. Keeping
everything as plain JavaScript value makes it easier to work with other libraries and easier for the
JavaScript engine to optimize.
Val
s are managed with FinalizationRegistry
and WeakRef
which means
you can create and access derived Val.value
without worrying about memory leaks. Disposers
returned by subscriptions can also be easily managed with libraries like
@wopjs/disposable
.
npm add value-enhancer