Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@zenstack/react-zen-store
Advanced tools
React Zen Store is the React binding for [Zen Store](https://github.com/alaboudi/zen-store). It let's your React component retrieve the latest state from the store.
React Zen Store is the React binding for Zen Store. It let's your React component retrieve the latest state from the store.
yarn add @zenstack/react-zen-store
or
npm install @zenstack/react-zen-store
This library exposes some hooks that allow you to bind the Zen Store state value to your components.
useState
The useState
hook allows your component to stay in sync with the store.
import {createStateStore} from "@zenstack/zen-store";
import {useState} from "@zenstack/react-zen-stack";
const store = createStateStore(13);
const MyComponent = () => {
const state = useState(store); // assigned 13
return <p>{state} is my favorite nummber</p>;
}
useSelector
The useSelector
hook is similar to useState
but it provides the return value of the selector execution on the store.
import {createStateStore} from "@zenstack/zen-store";
import {useSelector} from "@zenstack/react-zen-store";
const store = createStateStore(13);
const selector = (x) => x * 2;
const MyComponent = () => {
const state = useSelector(store, selector); // assigned 26
return <p>{state} is double my favorite number</p>
}
FAQs
React Zen Store is the React binding for [Zen Store](https://github.com/alaboudi/zen-store). It let's your React component retrieve the latest state from the store.
The npm package @zenstack/react-zen-store receives a total of 0 weekly downloads. As such, @zenstack/react-zen-store popularity was classified as not popular.
We found that @zenstack/react-zen-store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.