
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.
Simple state/store manager based on Proxy.
createStore(name, object) – creates new store with provided name
useStore(config: string | object | array ) – subscribe component to store
useStore({ user: ['firstName'] }) – to field firstName of store user
useStore({ user: true }) – to all fields of store user
useStore('user') – to all fields of stores user
useStore(['user', 'auth']) - to all fields of stores user and auth
useStore(['user', { auth: ['isAuthorized'] }])
userisAuthorized of store authconnect(storeName: string, fields: string[], callback: () => void) – subscribe callback to store.
disconnect(storeName: string, fields: string[], callback: () => void) – unsubscribe callback to store.
store.originalObject – returns original object (without Proxy wrapper)import { createStore, connect, disconnect } from 'justorm'; // for VanillaJS
// or
import { createStore, useStore } from 'justorm/react'; // for React
// or
import { createStore, useStore } from 'justorm/preact'; // for Preact
NOTE: You don't need to unsubscribe from store when using decorator
useStore.useStoredo it for you.
Describe store and actions in one place. Demo.
createStore('user', {
isLogged: false,
login() {
this.isLogged = true;
},
logout() {
this.isLogged = false;
},
});
function App() {
const { isLogged, login, logout } = useStore({ user: ['isLogged'] });
const onClick = isLogged ? logout : login;
const text = isLogged ? 'logout' : 'login';
return <button onClick={onClick}>{text}</button>;
});
Demo.
import { createStore, connect, disconnect } from 'justorm';
const myStore = createStore('my-store', {
isLogged: false;
user: null
});
function onLoggedChange() {
console.log(myStore.isLogged ? 'Welcome!' : 'See ya!');
}
function onAnyFieldChange() {
console.log('Some field changed:', myStore);
}
connect('my-store', ['isLogged'], onLoggedChange);
connect('my-store', onAnyFieldChange);
myStore.isLogged = true;
// Welcome!
// Some field changed: { isloggeg: true, user: null }
console.log('-----------');
myStore.user = 'Jess';
// Some field changed: { isloggeg: true, user: 'Jess' }
console.log('-----------');
Object.assign(myStore, { isLogged: false, user: null });
// See ya!
// Some field changed: { isLogged: false, user: null }
// Some field changed: { isLogged: false, user: null }
disconnect('my-store', onLoggedChange);
disconnect('my-store', onAnyFieldChange);
FAQs
Just store manager.
The npm package justorm receives a total of 54 weekly downloads. As such, justorm popularity was classified as not popular.
We found that justorm 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
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.