Socket
Socket
Sign inDemoInstall

jotai-nexus

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jotai-nexus

A small Typescript package to access Jotai atoms outside of React components. Inspired by Recoil-Nexus


Version published
Weekly downloads
14
decreased by-75.44%
Maintainers
1
Weekly downloads
 
Created
Source

J O T A I - N E X U S

Inspired by Recoil Nexus

This package gives you the ability to access atom's, e.g read/write to them from outside React's tree.

Install

npm

npm i jotai-nexus

yarn

yarn add jotai-nexus

Usage

1. Add JotaiNexus to your main React file.

import React from "react";
import JotaiNexus, { readAtom, writeAtom } from "jotai-nexus";

// Somewhere in your code use readAtom(myAtom) or writeAtom(myAtom, myUpdate)

export default function App() {
  return (
    <SomeLayout>
      {/* ... */}
      <JotaiNexus />
    </SomeLayout>
  );
}

export default App;

2. Use the following methods to get/set values passing your atom as a parameter.

MethodReturns
readAtomgetter
writeAtomsetter function, pass value to be set as second parameter

Keywords

FAQs

Package last updated on 16 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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