You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR; Check out clockelliptic/jotai-recoil-adapter. It's rough around the edges and could use community support, but has proven to be very useful so far. Please feel invited to contribute, fork, and copy as needed.
🔍 What is jotai-recoil-adapter?
The jotai-recoil-adapter is intended to facilitate a less-painful transition from Recoil to Jotai. It provides an API compatible with Recoil while leveraging the simplicity and efficiency of Jotai under the hood. Our goal is to make it easier for teams reliant on Recoil to migrate to Jotai without having to overhaul their existing codebases.
🌟 Features Include:
An API mirroring key Recoil functionalities, such as atom, selector, useRecoilState, and more.
🤝 We Need Your Input!
This project is in its early stages, and community input is invaluable.
Current top priorities include:
expanded adapter APIs to support migration from Recoil's writable selectors (proxy selectors)
expanded adapter APIs for other Recoil APIs
test suite development
development of migration docs for Recoil APIs that aren't adaptable to Jotai
⚠️ Disclaimer: I do this in my spare time to help myself and others bootstrap their migration from Recoil to Jotai, please read the code and test your production applications thoroughly. This is a labor of love ❤️
exporttypeEffectArgs<T>={/* supported */onSet: (cb: (newVal: T,oldVal?: T)=>void)=>void;getPromise?: GetPromise;getLoadable?: GetLoadable;node?: AtomAdapter<T>;setSelf?: (value: T)=>void;/* unsafe/messy to support */resetSelf?: UNSUPPORTED;/* does not apply to Jotai */storeID?: UNSUPPORTED;trigger?: UNSUPPORTED;getInfo_UNSTABLE?: UNSUPPORTED;parentStoreID_UNSTABLE?: UNSUPPORTED;};exporttypeEffectFn<T>=(arg: EffectArgs<T>)=>void;
Adds support for getLoadable and getPromise methods in atom effects and useRecoilCallback:
exporttypeLoadable<T>=|{state: "hasValue";contents: T}|{state: "hasError";contents: Error}|{state: "loading"};exporttypeGetPromise=<T>(atom: AtomAdapter<T>)=>Promise<T>;exporttypeGetLoadable=<T>(atom: AtomAdapter<T>)=>Loadable<T>;exporttypeSnapshot={getPromise: GetPromise;getLoadable: GetLoadable;retain: ()=>()=>void;// does nothing, merely for drop-in convenience};
Supported or partially supported APIs
import{/* standard Recoil APIs, fully or partially supported */RecoilRoot,atom,atomFamily,selector,selectorFamily,useRecoilCallback,useRecoilState,useRecoilValue,useSetRecoilState,useResetRecoilState,useRecoilBridgeAcrossReactRoots_UNSTABLE,/* interfaces, fully or partially implemented */Snapshot,Loadable,/* special adapters for compatibility */atomAsync,atomFamilyAsync,asyncSelector,asyncSelectorFamily,selectorDefault}from'jotai-recoil-adapter';
Hi everyone 👋,
TLDR; Check out clockelliptic/jotai-recoil-adapter. It's rough around the edges and could use community support, but has proven to be very useful so far. Please feel invited to contribute, fork, and copy as needed.
see it on NPM: https://www.npmjs.com/package/jotai-recoil-adapter
see also: #2288 #1495
🔍 What is jotai-recoil-adapter?
The
jotai-recoil-adapter
is intended to facilitate a less-painful transition from Recoil to Jotai. It provides an API compatible with Recoil while leveraging the simplicity and efficiency of Jotai under the hood. Our goal is to make it easier for teams reliant on Recoil to migrate to Jotai without having to overhaul their existing codebases.🌟 Features Include:
atom
,selector
,useRecoilState
, and more.🤝 We Need Your Input!
This project is in its early stages, and community input is invaluable.
Current top priorities include:
🔗 Get Involved:
The text was updated successfully, but these errors were encountered: