Commit 92291a4
authored
Bump @preact/signals-core from 1.12.2 to 1.13.0 (#561)
Bumps [@preact/signals-core](https://github.com/preactjs/signals) from
1.12.2 to 1.13.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/preactjs/signals/releases"><code>@preact/signals-core</code>'s
releases</a>.</em></p>
<blockquote>
<h2><code>@preact/signals-core</code><a
href="https://github.com/1"><code>@1</code></a>.13.0</h2>
<h3>Minor Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/preactjs/signals/pull/812">#812</a> <a
href="https://github.com/preactjs/signals/commit/19ac39bb4a7a3273090753a50a58efb717f5553d"><code>19ac39b</code></a>
Thanks <a
href="https://github.com/andrewiggins"><code>@andrewiggins</code></a>!
- Add <code>createModel</code> and <code>action</code> to signals core
package</p>
<p><strong><code>createModel</code></strong> provides a structured way
to create reactive model classes that encapsulate signals, computed
values, and actions:</p>
<pre lang="js"><code>const CounterModel = createModel((initialCount = 0)
=> {
const count = signal(initialCount);
const doubled = computed(() => count.value * 2);
<pre><code>effect(() =&gt; {
console.log(&quot;Count changed:&quot;, count.value);
});
return {
count,
doubled,
increment() {
count.value++;
},
};
</code></pre>
<p>});</p>
<p>const counter = new CounterModel(5);
counter.increment(); // Updates are automatically batched
counter<a href="">Symbol.dispose</a>; // Cleans up all effects
</code></pre></p>
<p>Key features:</p>
<ul>
<li>Factory functions can accept arguments for initialization</li>
<li>All methods are automatically wrapped as actions (batched &
untracked)</li>
<li>Effects created during model construction are captured and disposed
when the model is disposed via <code>Symbol.dispose</code></li>
<li>TypeScript validates that models only contain signals, actions, or
nested objects with signals/actions</li>
</ul>
<p><strong><code>action</code></strong> is a helper that wraps a
function to run batched and untracked:</p>
<pre lang="js"><code>const updateAll = action(items => {
items.forEach(item => item.value++);
}); // All updates batched into single notification
</code></pre>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/preactjs/signals/commits/@preact/[email protected]">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>1 parent 539e05d commit 92291a4
2 files changed
+5
-5
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| |||
0 commit comments