orpheus-bind
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "orpheus-bind", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "JoaoPauloCMarra <joaopaulocmarra@gmail.com> (http://webnexus.com.br/)", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -11,2 +11,3 @@ # OrpheusBind 🎶 | ||
- No need to install RxJS separately | ||
- Middleware support for intercepting and modifying actions or updates | ||
- Lightweight and easy to integrate | ||
@@ -19,2 +20,8 @@ | ||
```bash | ||
npm install orpheus-bind | ||
``` | ||
or | ||
```bash | ||
yarn add orpheus-bind | ||
@@ -32,3 +39,3 @@ ``` | ||
import { createGlobalState } from 'orpheus-bind'; | ||
import { createGlobalState, Middleware } from 'orpheus-bind'; | ||
@@ -46,3 +53,9 @@ export interface UserGlobalState { | ||
export const useUserGlobalState = createGlobalState<UserGlobalState>(initialState); | ||
// Optional middleware for logging state updates | ||
const loggingMiddleware: Middleware<UserGlobalState> = (currentState, newStateOrUpdater) => { | ||
console.log('Updating state:', currentState, newStateOrUpdater); | ||
return newStateOrUpdater; | ||
}; | ||
export const useUserGlobalState = createGlobalState<UserGlobalState>(initialState, loggingMiddleware); | ||
``` | ||
@@ -88,11 +101,2 @@ | ||
# 🚀 Future Features | ||
- Middleware support for intercepting and modifying actions or updates | ||
- DevTools integration for easy debugging and monitoring of state changes | ||
- Code splitting and lazy loading support | ||
- Efficient updates and memoization to minimize unnecessary renders | ||
- Scoped state management for better application structure | ||
- Easier integration with other popular libraries | ||
- Better error handling and recovery | ||
- Comprehensive documentation and examples | ||
#### also check the [DEMO](src/demo) application to see a simplier implementation example |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13680
284
98
0
18