Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.