@azrico/global 1.3.64 → 1.3.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/global",
3
- "version": "1.3.64",
3
+ "version": "1.3.65",
4
4
  "description": "Simple global functions and helpers",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",
@@ -75,12 +75,10 @@
75
75
  ],
76
76
  "dependencies": {
77
77
  "@react-native-async-storage/async-storage": "^1.15.5",
78
- "pullstate": "^1.24.0",
79
78
  "react": "^18.0.0"
80
79
  },
81
80
  "peerDependencies": {
82
81
  "@react-native-async-storage/async-storage": "^1.15.5",
83
- "pullstate": "^1.24.0",
84
82
  "react": "^18.0.0"
85
83
  },
86
84
  "optionalDependencies": {
package/dist/gstate.d.ts DELETED
@@ -1 +0,0 @@
1
- export * as gstate from "./packages/state";
package/dist/gstate.js DELETED
@@ -1 +0,0 @@
1
- "use strict";var _gstate=_interopRequireWildcard(require("./packages/state"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.gstate=void 0;exports.gstate=_gstate;function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d["default"]=a,c&&c.set(a,d),d}
@@ -1,48 +0,0 @@
1
- import { TUpdateFunction } from "pullstate";
2
- /**
3
- * Set state
4
- * @param state_name update function
5
- * @returns false if StateHandler is not defined, true otherwise
6
- */
7
- export declare function set_state(state_updater: TUpdateFunction<any>): boolean;
8
- /**
9
- * Set state
10
- * @param state_name state name
11
- * @param value
12
- * @returns false if StateHandler is not defined, true otherwise
13
- */
14
- export declare function set_state(state_name: string, value?: any): boolean;
15
- /**
16
- * Add value to state array
17
- * @param state_name
18
- * @param value
19
- */
20
- export declare function add_state(state_name: string, value: any): void;
21
- /**
22
- * remove value from state array
23
- * @param state_name
24
- * @param value
25
- */
26
- export declare function remove_state(state_name: string, value: any): void;
27
- /**
28
- * Add value to state object
29
- * @param state_name
30
- * @param key
31
- * @param value
32
- */
33
- export declare function set_keystate(state_name: string, key: string, value: any): void;
34
- /**
35
- * remove value from state object
36
- * @param state_name
37
- * @param key
38
- */
39
- export declare function remove_keystate(state_name: string, key: string): void;
40
- /**
41
- * Returns a state by its name
42
- * @param state_name
43
- * @returns the state
44
- */
45
- export declare function use_state<T>(state_name: string): T | undefined;
46
- export declare function hold_set_state(state_name: string, value: any): any;
47
- export declare function hold_set_keystate(state_name: string, key: string, value: any): any;
48
- export declare function hold_add_state(state_name: string, value: any): any;
@@ -1,22 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.add_state=add_state,exports.hold_add_state=hold_add_state,exports.hold_set_keystate=hold_set_keystate,exports.hold_set_state=hold_set_state,exports.remove_keystate=remove_keystate,exports.remove_state=remove_state,exports.set_keystate=set_keystate,exports.set_state=set_state,exports.use_state=use_state;var _pullstate=require("pullstate"),_react=_interopRequireDefault(require("react"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"===_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!==_typeof(a)||null===a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var d=c.call(a,b||"default");if("object"!==_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}var DataStore;function set_state(a,b){return null==DataStore&&(DataStore=new _pullstate.Store({})),DataStore.update(function(c){if(c&&"object"==_typeof(c)||(c={}),"function"==typeof a){var d=a(c);null!=d&&(c=d)}else c[a]=b}),!0}/**
2
- * Add value to state array
3
- * @param state_name
4
- * @param value
5
- */function add_state(a,b){set_state(function(c){c&&"object"==_typeof(c)||(c={});var d=Array.isArray(c[a])?c[a]:[];return c[a]=[].concat(_toConsumableArray(d),[b]),c})}/**
6
- * remove value from state array
7
- * @param state_name
8
- * @param value
9
- */function remove_state(a,b){set_state(function(c){if(c){var d=Array.isArray(c[a])?c[a]:[];c[a]=d.filter(function(a){return a!==b})}return c})}/**
10
- * Add value to state object
11
- * @param state_name
12
- * @param key
13
- * @param value
14
- */function set_keystate(a,b,c){set_state(function(d){d&&"object"==_typeof(d)||(d={});var e=d[a];return e=null==e||"object"!==_typeof(e)?{}:_objectSpread({},e),e[b]=c,d[a]=e,d})}/**
15
- * remove value from state object
16
- * @param state_name
17
- * @param key
18
- */function remove_keystate(a,b){set_state(function(c){if(c){var d=c[a];null==d||"object"!==_typeof(d)?d={}:delete d[b],c[a]=d}return c})}/**
19
- * Returns a state by its name
20
- * @param state_name
21
- * @returns the state
22
- */function use_state(a){var b;return null===(b=DataStore)||void 0===b?void 0:b.useState(function(b){return b[a]})}/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */function hold_set_state(a,b){return _react["default"].useEffect(function(){return set_state(a,b),function(){set_state(a,void 0)}},[b]),b}function hold_set_keystate(a,b,c){return _react["default"].useEffect(function(){return set_keystate(a,b,c),function(){set_keystate(a,b,void 0)}},[c]),c}function hold_add_state(a,b){return _react["default"].useEffect(function(){return add_state(a,b),function(){remove_state(a,void 0)}},[b]),b}
@@ -1 +0,0 @@
1
- export * from "./g_state";
@@ -1 +0,0 @@
1
- "use strict";var _g_state=require("./g_state");Object.defineProperty(exports,"__esModule",{value:!0});Object.keys(_g_state).forEach(function(a){"default"===a||"__esModule"===a||a in exports&&exports[a]===_g_state[a]||Object.defineProperty(exports,a,{enumerable:!0,get:function get(){return _g_state[a]}})});