Closed andrewiggins closed 10 months ago
Latest commit: cb7c2a3271bd05b70c7652781371f91cddb3dfef
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Name | Link |
---|---|
Latest commit | cb7c2a3271bd05b70c7652781371f91cddb3dfef |
Latest deploy log | https://app.netlify.com/sites/preact-signals-demo/deploys/656e6d959764990008cf5287 |
Deploy Preview | https://deploy-preview-459--preact-signals-demo.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Size Change: -42 B (0%)
Total Size: 84.1 kB
Filename | Size | Change | |
---|---|---|---|
docs/dist/assets/client.********.js |
46.8 kB | +27 B (0%) | |
docs/dist/react-********.js |
238 B | -2 B (-1%) | |
packages/react-transform/dist/signals-*********.js |
4.75 kB | -85 B (-2%) | |
packages/react-transform/dist/signals-transform.mjs |
4 kB | -85 B (-2%) | |
packages/react-transform/dist/signals-transform.umd.js |
4.87 kB | -82 B (-2%) | |
packages/react/dist/signals.js |
1.52 kB | +91 B (+6%) | đ |
packages/react/dist/signals.mjs |
1.49 kB | +94 B (+7%) | đ |
This PR adds tests and supported for nested
useSignals
calls when combined in components & hooks. We generally have two different mechanisms to call useSignals: 1) using react-transform & 2) callinguseSignals()
directly in a component or hook.To support mixing and matching these scenarios, I've added parameter to
useSignals()
that specifies how this invocation is being used. It primarily exists for the transform to telluseSignals
it is gonna be manually closed by the code the transform emits.Using this parameter, when I new store starts, it can examine the previous store and properly handle closing it out or "capture and restoring it" once the current store finishes. See the comment in
runtime/src/index.ts:_start()
for a detailed description of the exact behavior here.