bunshi
bunshi copied to clipboard
Molecule pattern for jotai, valtio, zustand, nanostores, xstate, react and vue
One thing I was hoping to do is replace [a custom implementation of Jotai](https://github.com/pmndrs/jotai/discussions/1422) that leverages `unstable_createStore` to read / write atoms in utility functions (outside a React context). Jotai-molecules...
## Description of the change Fixes #11 by making a new inferable scope type. I tried to edit ScopeTuple, but it's used in so many places and would've been a...
Consider the following scenario ``` type SomeType = {}; const myScope = createScope(undefined); // ... const myScopeThing:SomeType = {}; const myThing = useMolecule(someMolecule,{ withScope:[myScope,myScopeThing] }) ``` `withScope:[myScope,myScopeThing]` throws an error...
Hey! (Firstly, this library is bloody amazing. IMO it should be first class for jotai.) I have complicated molecules that I'd like to unit test. I'd appreciate some simple react-less...
I noticed that if I don't call the `getScope` function during the creation of a `molecule` the atoms end up being shared on `useMolecule`. I'm also using both the `ScopeProvider`...
If there is a circular dependency between molecules, it will produce a `maximum call stack exceeded` error. We should detect these loops and provide a more useful error message to...
## Description of the change > Molecule export was missing ## Type of change - [x] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking...
## Description of the change This PR adds eslint configuration for fixing browser compatibility errors. However this doesn't detect array methods such as `toSorted` #53 https://github.com/amilajack/eslint-plugin-compat/issues/258#issue-485635549. I've also tried to...
I tried to use it with React Native but got a warning and an error: warning: ``` warn Package bunshi has been ignored because it contains invalid configuration. Reason: Package...
(refactor/react): Memoize ComponentScope unique value with useState to ensure referential stability.
## Description of the change According to React Docs, `useMemo`'s result can be forgotten under special circumstances. To avoid this potential behavior, we could use `useState` to create a stable...