
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Xi-store. Tiny and powerfull state manager for preact. Compatible with react with typescript support
Tiny state manager for react/preact programming infrastructure. Inspired by storeon
Based on react/hooks module
compact:
understandable API (like react/hooks)
npm install https://github.com/Sanshain/react-store.git
Default state initialization:
import { initStore } from "states";
initStore({
count: 9
})
Local state initialization:
import { useStore } from "states";
const [count, setCount] = useStore('count')
State update:
const [count, setCount] = useStore('count')
//...
<button onClick={(e) => setCount(count + 1)}>
//...
index.js:
import { h, render } from 'preact'
import App from './App'
import { initStore } from "./store/state";
initStore({
count: 9
})
render(<App/>, document.getElementById('root'))
App.jsx:
import { h, Fragment } from 'preact'
import { useState } from 'preact/hooks'
import { useStore, initStore } from "./store/state";
import Button from "./button";
const App = props => {
const [message] = useState('Preact App')
const [count, setCount] = useStore('count')
return <>
<header />
<main class={BtnClassName}>
<h1 class='title'>{message}</h1>
<button onClick={(e) => setCount(count + 1)}>
{count}
</button>
</main>
<Button />
</>
}
export default App
button.jsx:
import { h, Fragment } from 'preact'
import { useState } from 'preact/hooks'
import { useStore } from "./store/state";
const Button = props => {
const [text] = useState('minus')
const [count, setCount] = useStore('count', 0)
return <>
<hr/>
<div>
<button onClick={e => setCount(count - 1)}>{text} ({count})</button>
</div>
</>
}
export default Button
Look live example here
FAQs
Xi-store. Tiny and powerfull state manager for preact. Compatible with react with typescript support
We found that xi-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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.