@preact/signals-core
1.14.5 · 27 Oct 2026MIT17.2M / weekRepositoryHomepagenpmAtom feed
1.14.5 is the newest release of 1.x.
In short
1 new
Release note
Minor Changes
Add
createModelandactionto signals core packagecreateModelprovides a structured way to create reactive model classes that encapsulate signals, computed values, and actions:const CounterModel = createModel((initialCount = 0) => { const count = signal(initialCount); const doubled = computed(() => count.value * 2); effect(() => { console.log("Count changed:", count.value); }); return { count, doubled, increment() { count.value++; }, }; }); const counter = new CounterModel(5); counter.increment(); // Updates are automatically batched counter[Symbol.dispose](); // Cleans up all effectsKey features:
Factory functions can accept arguments for initialization
All methods are automatically wrapped as actions (batched & untracked)
Effects created during model construction are captured and disposed when the model is disposed via
Symbol.disposeTypeScript validates that models only contain signals, actions, or nested objects with signals/actions
actionis a helper that wraps a function to run batched and untracked:const updateAll = action(items => { items.forEach(item => item.value++); }); // All updates batched into single notification
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.