
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
A simple react state management library without a provider
https://codesandbox.io/s/minact-demo-b3f6nd
npm install minact
# or
# yarn add minact
import { createStore } from "minact";
export const { useSelector, useDispatch } = createStore(
{ count: 0 },
(set, get) => ({
increase: (amount) => set({ count: get().count + (amount || 1) }),
})
);
const View = () => {
const count = useSelector((state) => state.count);
return <div>Count: {count}</div>;
};
const Controls = () => {
const increase = useDispatch((reducers) => reducers.increase);
return <button onClick={() => increase()}>Increase</button>;
};
Just call the set function to update the store, async functions don't matter.
createStore({ data: null }, (set, get) => ({
update: async (url) => {
const res = await fetch(url);
const data = await res.json();
set({ data });
},
}));
const App = () => {
const { count, user } = useSelector((state) => ({
count: state.count,
user: state.user,
}));
// or
const [ count, user ] = useSelector((state) => [
count: state.count,
user: state.user,
]);
// useDispatch also works
const { increase, decrease } = useDispatch((reducers) => ({
increase: reducers.increase,
decrease: reducers.decrease,
}));
// or
const [ increase, decrease ] = useDispatch((reducers) => [
increase: reducers.increase,
decrease: reducers.decrease,
]);
};
const store = createStore({ count: 0 }, (set, get) => ({
increase: () => set({ count: get().count + 1 }),
}));
// Subscribe to store changes and log the state
const unsubscribe = store.subscribe(() => console.log(store.get()));
// Unsubscribe from changes
unsubscribe();
src
│── store
│ │── user-store.js
│ │── count-store.js
│ │── any-store.js
You can create as many store as you want, they will work independently from each other
FAQs
A simple react state management library without a provider
We found that minact 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.