
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
estates-test
Advanced tools
 [](https://github.com/philipodev/estate-test/actions/workflows/build-test.yml)
React.Context and useStateyarn add estate immer
npm install estate immer --save
Essentially it's a modifyable react context. It uses react's context API and states to store and edit the data.
It uses immer (shipped with redux-toolkit) to make sure that the data is immutable.
const CounterEstate = createEstate({
initialState: {
count: 0,
},
actions: {
increment(state) {
state.count++;
},
decrement(state) {
state.count--;
},
setCount(state, by: number) {
state.count = by;
},
},
});
function Counter() {
return (
<CounterEstate.Root>
<Count />
</CounterEstate.Root>
);
}
function Count() {
const {
state: { count },
} = useEstate(CounterEstate);
return <div>count: {count}</div>;
}
function Buttons() {
const { increment, decrement, setCount } = useEstate(CounterEstate);
return (
<div>
<button onClick={() => increment()}>+</button>
<button onClick={() => decrement()}>-</button>
<button onClick={() => setCount(5)}>Set to 5</button>
</div>
);
}
Compared to a global state where this could get a bit annoying with props drilling and internal state management, this is a little more declarative.
In this example we render three Counters (see above). They all have their own context and it's children can read/edit the state for that tree.
function App(){
return (
<div style={{ display: "flex", gap: 40 }}>
<Counter />
<Counter />
<Counter />
</div>
);
}

Feel free to help implement these features by opening pull requests
Root and a connector for class components.FAQs
 [](https://github.com/philipodev/estate-test/actions/workflows/build-test.yml)
We found that estates-test 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.