signals
signals copied to clipboard
Manage state with style in every framework
# Description This PR adds ~80 bytes to the final bundle by refactoring sources (*not* targets) to use arrays instead of LinkedList. But it makes it up by improving performance...
I tried using `@preact/signals-react` in a project with react-router 6 but I got that error which doesn't make any sense to me, the error is complaining about react-router but originates...
When importing `@preact/signals-react` into a Next.js app (and possibly other frameworks) it breaks fast refresh in local development. I've created a simple reproduction [here](https://github.com/souporserious/preact-signals-nextjs) that showcases the problem. My guess...
For both React and Preact, the `useSignal` hook implementation is currently defined as: https://github.com/preactjs/signals/blob/ccb677bdb26ef836d3fac39d30d8f6371693e60f/packages/preact/src/index.ts#L334-L336 This implementation would cause the returned signal's `.value` to only be kept in sync with the...
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action...
The callback passed to `useSignalEffect` should be executed after the changes (if any) have been applied to the DOM. Otherwise, it won't be a direct replacement for `useEffect`. For example,...
The `effect` function signature is changed in order to more closely match the `useSignalEffect` signature, and also remove the ambiguity of the `unknown` typing. The `useSignalEffect` hook also now properly...
Given a signal `foo` and an effect logging its value. When I run a batch, which changes the value of `foo` in such a way that it is essentially a...
The latest version of @preact/signals-react not work with forwardRef when use with `{xxx.value}`. This is the demo({count} works, but {count.value} not): https://codesandbox.io/s/preact-signals-react-forwardref-not-work-k5pcry?file=/src/App.js This PR fixes this.
A signal will only fire if a "new" value is assigned. So if I use a signal with a reference type, e.g. an array, updating the value will not actually...