recoil-nexus
Advanced tools
Comparing version 0.3.14 to 0.3.15
@@ -1,5 +0,8 @@ | ||
import { useRecoilCallback } from 'recoil'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resetRecoil = exports.setRecoil = exports.getRecoilPromise = exports.getRecoil = void 0; | ||
var recoil_1 = require("recoil"); | ||
var nexus = {}; | ||
export default function RecoilNexus() { | ||
nexus.get = useRecoilCallback(function (_a) { | ||
function RecoilNexus() { | ||
nexus.get = (0, recoil_1.useRecoilCallback)(function (_a) { | ||
var snapshot = _a.snapshot; | ||
@@ -10,3 +13,3 @@ return function (atom) { | ||
}, []); | ||
nexus.getPromise = useRecoilCallback(function (_a) { | ||
nexus.getPromise = (0, recoil_1.useRecoilCallback)(function (_a) { | ||
var snapshot = _a.snapshot; | ||
@@ -17,7 +20,7 @@ return function (atom) { | ||
}, []); | ||
nexus.set = useRecoilCallback(function (_a) { | ||
nexus.set = (0, recoil_1.useRecoilCallback)(function (_a) { | ||
var set = _a.set; | ||
return set; | ||
}, []); | ||
nexus.reset = useRecoilCallback(function (_a) { | ||
nexus.reset = (0, recoil_1.useRecoilCallback)(function (_a) { | ||
var reset = _a.reset; | ||
@@ -28,14 +31,19 @@ return reset; | ||
} | ||
export function getRecoil(atom) { | ||
exports.default = RecoilNexus; | ||
function getRecoil(atom) { | ||
return nexus.get(atom); | ||
} | ||
export function getRecoilPromise(atom) { | ||
exports.getRecoil = getRecoil; | ||
function getRecoilPromise(atom) { | ||
return nexus.getPromise(atom); | ||
} | ||
export function setRecoil(atom, valOrUpdater) { | ||
exports.getRecoilPromise = getRecoilPromise; | ||
function setRecoil(atom, valOrUpdater) { | ||
nexus.set(atom, valOrUpdater); | ||
} | ||
export function resetRecoil(atom) { | ||
exports.setRecoil = setRecoil; | ||
function resetRecoil(atom) { | ||
nexus.reset(atom); | ||
} | ||
exports.resetRecoil = resetRecoil; | ||
//# sourceMappingURL=RecoilNexus.js.map |
{ | ||
"name": "recoil-nexus", | ||
"version": "0.3.14", | ||
"version": "0.3.15", | ||
"description": "A small Typescript package to access your Recoil atoms outside of React components.", | ||
@@ -5,0 +5,0 @@ "main": "build/RecoilNexus.js", |
{ | ||
"compilerOptions": { | ||
"outDir": "build", | ||
"module": "esnext", | ||
"module": "commonjs", | ||
"target": "es5", | ||
@@ -6,0 +6,0 @@ "lib": [ |
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
9669
118