
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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 2 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.