react-globo-state 1.0.2 → 1.0.5

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/global.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ /*!
2
+ Copyright (c) 2025 Dario Passariello <dariopassariello@gmail.com>
3
+ Licensed under MIT License, see
4
+ https://dario.passariello.ca
5
+ */
6
+
7
+ interface _gState {
8
+ set: (name: string, value: string | number | string[] | object) => void,
9
+ get: (name: string) => void,
10
+ remove: (name: string) => void,
11
+ delete: (name: string) => void,
12
+ deleteAll: () => void,
13
+ list: () => void
14
+ }
15
+
16
+ declare var gState: _gState
17
+ type gState = _gState
package/index.js CHANGED
@@ -1 +1 @@
1
- import{useState as n}from"react";const e={},u=()=>{const[r,o]=n(null);return globalThis.gState={get:t=>{if(t&&t)return r?.[t]?r[t]:null},set:(t,l)=>{!t||!l||(e[t]=l,o({...e}))},remove:t=>{t&&(delete e[t],o({...e}))},delete:t=>{t&&gState.remove(t)},list:()=>r},u};var f=u;export{f as default,u as globoState};
1
+ import{useState as n}from"react";const e={},u=()=>{const[r,l]=n(null);return globalThis.gState={get:t=>{if(t&&t)return r?.[t]?r[t]:null},set:(t,o)=>{!t||!o||(e[t]=o,l({...e}))},remove:t=>{t&&(delete e[t],l({...e}))},delete:t=>{t&&gState.remove(t)},deleteAll:()=>{l({})},list:()=>r},u};var f=u;export{f as default,u as globoState};
package/package.json CHANGED
@@ -1,36 +1,39 @@
1
- {
2
- "name": "react-globo-state",
3
- "version": "1.0.2",
4
- "description": "A react state everywhere made easy",
5
- "keywords": [
6
- "react",
7
- "state",
8
- "render",
9
- "global",
10
- "dario",
11
- "passariello"
12
- ],
13
- "license": "MIT",
14
- "author": "Dario Passariello",
15
- "type": "module",
16
- "main": "./index.js",
17
- "types": "./index.d.ts",
18
- "dependencies": {
19
- "react": "^19.2.3"
20
- },
21
- "scripts": {
22
- "build": "node ./esbuild.config.mjs",
23
- "npm:publish": "npm run build && npm publish ./dist"
24
- },
25
- "devDependencies": {
26
- "@typescript-eslint/eslint-plugin": "8.53.0",
27
- "@typescript-eslint/parser": "8.53.0",
28
- "esbuild": "0.27.2",
29
- "esbuild-plugin-copy": "2.1.1",
30
- "eslint": "9.39.2",
31
- "ts-jest": "29.4.6",
32
- "ts-node": "^10.9.2",
33
- "tslib": "^2.8.1",
34
- "typescript": "^5.9.3"
35
- }
36
- }
1
+ {
2
+ "name": "react-globo-state",
3
+ "version": "1.0.5",
4
+ "description": "A react state everywhere made easy",
5
+ "keywords": [
6
+ "react",
7
+ "state",
8
+ "render",
9
+ "global",
10
+ "dario",
11
+ "passariello"
12
+ ],
13
+ "files": [
14
+ "index.js",
15
+ "global.d.ts"
16
+ ],
17
+ "license": "MIT",
18
+ "author": "Dario Passariello",
19
+ "type": "module",
20
+ "main": "./index.js",
21
+ "types": "./global.d.ts",
22
+ "dependencies": {
23
+ "react": "^19.2.3"
24
+ },
25
+ "scripts": {
26
+ "build": "node ./esbuild.config.mjs",
27
+ "npm:publish": "npm run build && npm publish ./dist"
28
+ },
29
+ "devDependencies": {
30
+ "@typescript-eslint/eslint-plugin": "8.53.0",
31
+ "@typescript-eslint/parser": "8.53.0",
32
+ "esbuild": "0.27.2",
33
+ "esbuild-plugin-copy": "2.1.1",
34
+ "eslint": "9.39.2",
35
+ "ts-jest": "29.4.6",
36
+ "tslib": "^2.8.1",
37
+ "typescript": "^5.9.3"
38
+ }
39
+ }
package/CODEOWNERS DELETED
@@ -1 +0,0 @@
1
- * @passariello
package/COPYRIGHT.md DELETED
@@ -1,4 +0,0 @@
1
- # Copyright
2
-
3
- Copyright (c) 2025, Dario Passariello. All rights reserved.
4
- <https://dario.passariello.ca>
package/SECURITY.md DELETED
@@ -1,3 +0,0 @@
1
- # Security
2
-
3
- Please email [@passariello](https://github.com/passariello) or see <https://dario.passariello.ca/contact/> if you have a potential security vulnerability to report.
package/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /*!
2
- Copyright (c) 2025 Dario Passariello <dariopassariello@gmail.com>
3
- Licensed under MIT License, see
4
- https://dario.passariello.ca
5
- */
6
-
7
-
8
- declare var gState = {} as any
9
- type gState = {}