87f69fd0bb
Based on #2345 , but with smaller API change - Use class implementation for `ReactiveEffect` - Switch internal creation of effects to use the class constructor - Avoid options object allocation - Avoid creating bound effect runner function (used in schedulers) when not necessary. - Consumes ~17% less memory compared to last commit - Introduces a very minor breaking change: the `scheduler` option passed to `effect` no longer receives the runner function. |
||
---|---|---|
.. | ||
__tests__ | ||
src | ||
api-extractor.json | ||
index.js | ||
LICENSE | ||
package.json | ||
README.md |
@vue/reactivity
Usage Note
This package is inlined into Global & Browser ESM builds of user-facing renderers (e.g. @vue/runtime-dom
), but also published as a package that can be used standalone. The standalone build should not be used alongside a pre-bundled build of a user-facing renderer, as they will have different internal storage for reactivity connections. A user-facing renderer should re-export all APIs from this package.
For full exposed APIs, see src/index.ts
. You can also run yarn build reactivity --types
from repo root, which will generate an API report at temp/reactivity.api.md
.
Credits
The implementation of this module is inspired by the following prior art in the JavaScript ecosystem:
Caveats
- Built-in objects are not observed except for
Array
,Map
,WeakMap
,Set
andWeakSet
.