Gathering detailed insights and metrics for little-state-machine
Gathering detailed insights and metrics for little-state-machine
Gathering detailed insights and metrics for little-state-machine
Gathering detailed insights and metrics for little-state-machine
little-state-machine-devtools
<div align="center"> <h1>Little State Machine Devtools</h1>
beedle
Beedle is a tiny little library to help you manage state across your application. Inspired by great libraries like Vuex and Redux, Beedle creates a central store that enables you to both better control and cascade state across your application.
little-fsm
A strongly-typed lightweight state machine library.
obvi
Little observable state machine
📠 React custom hook for persist state management
npm install little-state-machine
Typescript
Module System
Node Version
NPM Version
97.7
Supply Chain
97.8
Quality
79.8
Maintenance
100
Vulnerability
100
License
TypeScript (94.16%)
JavaScript (5.84%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,525 Stars
511 Commits
53 Forks
13 Watchers
12 Branches
20 Contributors
Updated on Jul 12, 2025
Latest Version
5.0.1
Package Id
little-state-machine@5.0.1
Unpacked Size
41.42 kB
Size
9.23 kB
File Count
14
NPM Version
9.6.4
Node Version
20.0.0
Published on
Jan 10, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
State management made super simple
sessionStorage
or localStorage
)$ npm install little-state-machine
createStore
Function to initialize the global store.
1function log(store) {
2 console.log(store);
3 return store;
4}
5
6createStore(
7 {
8 yourDetail: { firstName: '', lastName: '' } // it's an object of your state
9 },
10 {
11 name?: string; // rename the store
12 middleWares?: [ log ]; // function to invoke each action
13 storageType?: Storage; // session/local storage (default to session)
14 persist?: 'action' // onAction is default if not provided
15 // when 'none' is used then state is not persisted
16 // when 'action' is used then state is saved to the storage after store action is completed
17 // when 'beforeUnload' is used then state is saved to storage before page unloa
18 },
19);
useStateMachine
This hook function will return action/actions and the state of the app.
1const { actions, state, getState } = useStateMachine<T>({ 2 actions?: Record<string, Function> // Optional action to update global state 3 selector?: Function, // Optional selector to isolate re-render based on selected state 4});
Check out the Demo.
1import { createStore, useStateMachine } from 'little-state-machine'; 2 3createStore({ 4 yourDetail: { name: '' }, 5}); 6 7function updateName(state, payload) { 8 return { 9 ...state, 10 yourDetail: { 11 ...state.yourDetail, 12 ...payload, 13 }, 14 }; 15} 16 17function selector(state) { 18 return state.yourDetails.name.length > 10; 19} 20 21function YourComponent() { 22 const { actions, state } = useStateMachine({ actions: { updateName } }); 23 24 return ( 25 <buttton onClick={() => actions.updateName({ name: 'bill' })}> 26 {state.yourDetail.name} 27 </buttton> 28 ); 29} 30 31function YourComponentSelectorRender() { 32 const { state } = useStateMachine({ selector }); 33 return <p>{state.yourDetail.name]</p>; 34} 35 36const App = () => ( 37 <> 38 <YourComponent /> 39 <YourComponentSelectorRender /> 40 </> 41);
You can create a global.d.ts
file to declare your GlobalState's type.
Check out the example.
1import 'little-state-machine'; 2 3declare module 'little-state-machine' { 4 interface GlobalState { 5 yourDetail: { 6 name: string; 7 }; 8 } 9}
StateMachineProvider
has been removed, simple API1const App = () => ( 2- <StateMachineProvider> 3 <YourComponent /> 4- <StateMachineProvider> 5);
useStateMachine({ actions: { updateName } })
We also make BEEKAI. Build the next-generation forms with modern technology and best in class user experience and accessibility.
Thanks go to these wonderful people:
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More