recoil-nexus
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -6,5 +6,4 @@ import { useRecoilCallback } from 'recoil'; | ||
var snapshot = _a.snapshot; | ||
return function (_a) { | ||
var atom = _a.atom, resolve = _a.resolve; | ||
resolve(snapshot.getPromise(atom)); | ||
return function (atom) { | ||
return snapshot.getPromise(atom); | ||
}; | ||
@@ -14,6 +13,3 @@ }, []); | ||
var set = _a.set; | ||
return function (_a) { | ||
var atom = _a.atom, value = _a.value; | ||
set(atom, value); | ||
}; | ||
return set; | ||
}, []); | ||
@@ -23,9 +19,7 @@ return null; | ||
export function getRecoil(atom) { | ||
return new Promise(function (resolve) { | ||
nexus.get({ atom: atom, resolve: resolve }); | ||
}); | ||
return nexus.get(atom); | ||
} | ||
export function setRecoil(atom, value) { | ||
nexus.set({ atom: atom, value: value }); | ||
nexus.set(atom, value); | ||
} | ||
//# sourceMappingURL=RecoilNexus.js.map |
{ | ||
"name": "recoil-nexus", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "A small Typescript package to access your Recoil atoms outside of React components.", | ||
@@ -5,0 +5,0 @@ "main": "build/RecoilNexus.js", |
@@ -5,4 +5,2 @@ # R E C O I L - N E X U S | ||
#### Working with Recoil up to version 0.1.3 | ||
If you have been using **[recoil](https://recoiljs.org/)** for a while, you might have faced that outside React Components it's not possible to get or update values from atoms. | ||
@@ -91,3 +89,3 @@ | ||
Original credits to [VeepCream](https://github.com/VeepCream)'s [recoil-outside](https://www.npmjs.com/package/recoil-outside) Javascript implementation. | ||
In this Typescript package, I decided to remove RxJS and rely on promises only. | ||
Kudos to [VeepCream](https://github.com/VeepCream)'s [recoil-outside](https://www.npmjs.com/package/recoil-outside) original idea and Javascript implementation. | ||
In this Typescript port/enhancement, I decided to remove RxJS and rely on native Recoil promises only. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5788
67
89