Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
create-store
Advanced tools
Tiny (<300B minified + gzipped) state atoms that are updated via reducers.
import createStore from "create-store";
const initialState = { count: 0 };
function reducer(state, action) {
switch (action.type) {
case "INCREMENT":
return { count: state.count + 1 };
case "DECREMENT":
return { count: state.count - 1 };
}
}
const store = createStore(reducer, initialState);
console.log(store.getState().count); // => 0
store.dispatch({ type: "INCREMENT" });
console.log(store.getState().count); // => 1
create-store
is a lightweight implementation of a Redux store without advanced concepts like middleware.
npm install --save create-store
The best way to use create-store state atoms with React is to use useSubstate. You can find more information in the README of that library.
Every help on this project is greatly appreciated. To get you started, here's a quick guide on how to make good and clean pull-requests:
Create a fork of this repository, so you can work on your own environment.
Install development dependencies locally:
git clone git@github.com:<your-github-name>/create-store.git
cd create-store
yarn install
Make changes using your favorite editor.
Commit your changes (here is a wonderful guide on how to make amazing git commits).
After a few seconds, a button to create a pull request should be visible inside the Pull requests section.
FAQs
Create state atoms (stores) that are updated via reducers
The npm package create-store receives a total of 5 weekly downloads. As such, create-store popularity was classified as not popular.
We found that create-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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.