Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

recoil-nexus

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recoil-nexus - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

2

build/RecoilNexus.d.ts

@@ -1,2 +0,2 @@

import { RecoilValue, RecoilState } from 'recoil';
import { RecoilState, RecoilValue } from 'recoil';
export default function RecoilNexus(): null;

@@ -3,0 +3,0 @@ export declare function getRecoil<T>(atom: RecoilValue<T>): T;

@@ -5,5 +5,6 @@ "use strict";

var recoil_1 = require("recoil");
var recoil_2 = require("recoil");
var nexus = {};
function RecoilNexus() {
nexus.get = (0, recoil_1.useRecoilCallback)(function (_a) {
nexus.get = (0, recoil_2.useRecoilCallback)(function (_a) {
var snapshot = _a.snapshot;

@@ -14,3 +15,3 @@ return function (atom) {

}, []);
nexus.getPromise = (0, recoil_1.useRecoilCallback)(function (_a) {
nexus.getPromise = (0, recoil_2.useRecoilCallback)(function (_a) {
var snapshot = _a.snapshot;

@@ -21,12 +22,18 @@ return function (atom) {

}, []);
nexus.set = (0, recoil_1.useRecoilCallback)(function (_a) {
var transact_UNSTABLE = _a.transact_UNSTABLE;
return function (atom, valOrUpdater) {
transact_UNSTABLE(function (_a) {
var set = _a.set;
set(atom, valOrUpdater);
});
var getInfo = (0, recoil_1.useGetRecoilValueInfo_UNSTABLE)();
var transact = (0, recoil_2.useRecoilTransaction_UNSTABLE)(function (_a) {
var set = _a.set;
return set;
});
nexus.set = (0, recoil_2.useRecoilCallback)(function (_a) {
var set = _a.set;
return function (recoilState, valOrUpdater) {
var update = {
"atom": transact,
"selector": set
}[getInfo(recoilState).type];
update(recoilState, valOrUpdater);
};
}, []);
nexus.reset = (0, recoil_1.useRecoilCallback)(function (_a) {
nexus.reset = (0, recoil_2.useRecoilCallback)(function (_a) {
var reset = _a.reset;

@@ -33,0 +40,0 @@ return reset;

{
"name": "recoil-nexus",
"version": "0.4.0",
"version": "0.5.0",
"description": "A small Typescript package to access your Recoil atoms outside of React components.",

@@ -5,0 +5,0 @@ "main": "build/RecoilNexus.js",

@@ -22,3 +22,2 @@ {

"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,

@@ -25,0 +24,0 @@ "noUnusedParameters": true,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc