
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.
reactivity-store
Advanced tools
a reactive store, make you write reactive logic in react app just like zustand
Vue-inspired Reactive State Management for React
Bring Vue's reactivity system to React with zustand-like simplicity. Direct mutation, automatic UI updates - no manual subscriptions needed!
setState, just mutate and UI updates automaticallyref(), reactive(), computed() from @vue/reactivitynpm install reactivity-store
# or
pnpm add reactivity-store
For Vue developers or those wanting fine-grained reactivity:
import { createStore, ref, computed } from "reactivity-store";
const useCounter = createStore(() => {
const count = ref(0);
const doubled = computed(() => count.value * 2);
const increment = () => count.value++; // Direct mutation!
return { count, doubled, increment };
});
function App() {
const { count, doubled, increment } = useCounter();
return (
<div>
<p>Count: {count}</p>
<p>Doubled: {doubled}</p>
<button onClick={increment}>+1</button>
</div>
);
}
For React developers who want simplicity without learning Vue APIs:
import { createState } from "reactivity-store";
const useCounter = createState(
() => ({ count: 0 }),
{
withActions: (state) => ({
increment: () => state.count++,
decrement: () => state.count--
})
}
);
function App() {
const { count, increment, decrement } = useCounter();
return (
<div>
<p>Count: {count}</p>
<button onClick={increment}>+1</button>
<button onClick={decrement}>-1</button>
</div>
);
}
| 🟢 Vue Approach | 🔵 React Approach | |
|---|---|---|
| Best for | Vue developers | React developers |
| APIs | ref, reactive, computed | Plain objects + actions |
| Features | Auto-computed, lifecycle hooks | Middleware: persist, DevTools |
| Use | createStore | createState |
const useSettings = createState(
() => ({ theme: "light", language: "en" }),
{
withPersist: "app-settings", // Auto-saves to localStorage
withActions: (state) => ({
setTheme: (theme) => state.theme = theme
})
}
);
const useCounter = createState(
() => ({ count: 0 }),
{
withNamespace: "Counter", // Shows up in Redux DevTools
withActions: (state) => ({
increment: () => state.count++
})
}
);
const useStore = createState(
() => ({ nested: { count: 0 } }),
{
withDeepSelector: true, // Track nested changes (default: true)
withStableSelector: false, // Stable selector for performance
withActions: (state) => ({
increment: () => state.nested.count++
})
}
);
import { createStoreWithComponent, ref, onMounted, onUnmounted } from "reactivity-store";
const Timer = createStoreWithComponent({
setup: () => {
const seconds = ref(0);
let timer;
onMounted(() => {
timer = setInterval(() => seconds.value++, 1000);
});
onUnmounted(() => {
clearInterval(timer);
});
return { seconds };
}
});
function App() {
return <Timer>{({ seconds }) => <div>{seconds}s</div>}</Timer>;
}
import { useReactiveState } from "reactivity-store";
function TodoList() {
const [state, setState] = useReactiveState({
todos: [],
filter: "all"
});
const addTodo = (text) => {
setState((s) => {
s.todos.push({ id: Date.now(), text, done: false });
});
};
return <div>{/* ... */}</div>;
}
const useCounter = createState(
() => ({ count: 0 }),
{ withActions: (s) => ({ increment: () => s.count++ }) }
);
// Subscribe anywhere in your app
useCounter.subscribe(
(state) => state.count,
() => console.log("Count changed:", useCounter.getReadonlyState().count)
);
|
Traditional React
|
RStore (Vue Approach)
|
RStore (React Approach)
|
| API | Purpose |
|---|---|
createStore | Vue-style reactive stores with ref(), reactive(), computed() |
createState | React-style state with actions and middleware |
createStoreWithComponent | Component-scoped stores with lifecycle hooks |
useReactiveState | Component-local reactive state (like useState but reactive) |
useReactiveEffect | Side effects with automatic dependency tracking |
Visit https://mrwangjusttodo.github.io/r-store/ for complete documentation:
MIT © MrWangJustToDo
FAQs
a reactive store, make you write reactive logic in react app just like zustand
The npm package reactivity-store receives a total of 30,904 weekly downloads. As such, reactivity-store popularity was classified as popular.
We found that reactivity-store demonstrated a healthy version release cadence and project activity because the last version was released less than 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.