hank-zilla 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/README.md +1 -1
- package/dist/useAppState/appState.js +1 -1
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -165,7 +165,7 @@ function logCurrentState() {
|
|
|
165
165
|
| Feature | Hank-Zilla | Context API | Redux | Zustand |
|
|
166
166
|
| ----------------- | ----------- | ----------------- | ------------------ | ----------- |
|
|
167
167
|
| **Setup** | ❌ None | ✅ Provider | ✅ Store + Actions | ✅ Store |
|
|
168
|
-
| **Bundle Size** | 🟢 ~
|
|
168
|
+
| **Bundle Size** | 🟢 ~1.3KB | 🟢 Built-in | 🔴 ~45KB | 🟡 ~8KB |
|
|
169
169
|
| **Global Access** | ✅ Anywhere | ❌ Provider scope | ✅ Anywhere | ✅ Anywhere |
|
|
170
170
|
| **TypeScript** | 🟢 Full | 🟡 Manual | 🟢 Full | 🟢 Full |
|
|
171
171
|
|
package/dist/README.md
CHANGED
|
@@ -165,7 +165,7 @@ function logCurrentState() {
|
|
|
165
165
|
| Feature | Hank-Zilla | Context API | Redux | Zustand |
|
|
166
166
|
| ----------------- | ----------- | ----------------- | ------------------ | ----------- |
|
|
167
167
|
| **Setup** | ❌ None | ✅ Provider | ✅ Store + Actions | ✅ Store |
|
|
168
|
-
| **Bundle Size** | 🟢 ~
|
|
168
|
+
| **Bundle Size** | 🟢 ~1.3KB | 🟢 Built-in | 🔴 ~45KB | 🟡 ~8KB |
|
|
169
169
|
| **Global Access** | ✅ Anywhere | ❌ Provider scope | ✅ Anywhere | ✅ Anywhere |
|
|
170
170
|
| **TypeScript** | 🟢 Full | 🟡 Manual | 🟢 Full | 🟢 Full |
|
|
171
171
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect,useSyncExternalStore}from"react";import init$ from"./init$";const listeners=new Set,store={state:{},getState:()=>store.state,subscribe:t=>(listeners.add(t),()=>listeners.delete(t)),setState:(t,e)=>{store.state={...store.state,...Object.entries(t).reduce((t,[e,s])=>{const r=store.state[e];return t[e]="function"==typeof s?s(r):"object"==typeof s&&null!==s?Array.isArray(s)?Array.isArray(r)?[...r,...s]:[...s]:0===Object.keys(s).length?s:{...r||{},...s}:s,t},{})},e||listeners.forEach(t=>t())}};export const useAppState=(t,e,s=!1,r)=>(t in store.state||void 0===e||store.setState({[t]:e},r),
|
|
1
|
+
import{useEffect,useSyncExternalStore}from"react";import init$ from"./init$";const listeners=new Set,store={state:{},getState:()=>store.state,subscribe:t=>(listeners.add(t),()=>listeners.delete(t)),setState:(t,e)=>{store.state={...store.state,...Object.entries(t).reduce((t,[e,s])=>{const r=store.state[e];return t[e]="function"==typeof s?s(r):"object"==typeof s&&null!==s?Array.isArray(s)?Array.isArray(r)?[...r,...s]:[...s]:0===Object.keys(s).length?s:{...r||{},...s}:s,t},{})},e||listeners.forEach(t=>t())}};export const useAppState=(t,e,s=!1,r)=>(useEffect(()=>(t in store.state||void 0===e||store.setState({[t]:e},r),()=>{s&&deleteAppState(t)}),[t,s,e,r]),useSyncExternalStore(store.subscribe,()=>store.state[t]??e,()=>e));export const setAppState=(t,e,s)=>{store.setState({[t]:e},s)};export const getAppState=t=>void 0===t?store.getState():store.getState()[t];export const deleteAppState=t=>{t in store.state&&delete store.state[t]};init$({getAppState:getAppState});export default store;
|
package/package.json
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hank-zilla",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "A lightweight React state management library with modular architecture",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/phamdung2209/hank_zilla.git",
|
|
10
|
+
"type": "git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/phamdung2209/hank_zilla/issues"
|
|
14
|
+
},
|
|
8
15
|
"exports": {
|
|
9
16
|
".": {
|
|
10
17
|
"import": "./dist/index.js",
|
|
@@ -35,6 +42,9 @@
|
|
|
35
42
|
"clean": "rimraf dist",
|
|
36
43
|
"prepublishOnly": "npm run build",
|
|
37
44
|
"postbuild": "ls -la dist || dir dist",
|
|
45
|
+
"release:patch": "npm version patch && npm publish && git push origin --tags",
|
|
46
|
+
"release:minor": "npm version minor && npm publish && git push origin --tags",
|
|
47
|
+
"release:major": "npm version major && npm publish && git push origin --tags",
|
|
38
48
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
39
49
|
},
|
|
40
50
|
"keywords": [
|