hermes-io 2.4.44 → 2.4.46
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 +10 -14
- package/lib/hooks/useMutations.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
# hermes-io
|
|
2
|
-
|
|
1
|
+
# hermes-io <img src="https://hermes-io-docs.vercel.app/img/logo.png" width="40" height="40" />
|
|
2
|
+
|
|
3
|
+
A lightweight React library that allows communication between components by using the observer pattern and the hook api.
|
|
3
4
|
|
|
4
5
|
```
|
|
5
6
|
npm i hermes-io --save
|
|
6
7
|
```
|
|
8
|
+
Documentation: [here](https://hermes-io-docs.vercel.app/)
|
|
7
9
|
|
|
8
|
-
Check the documentation: [here](https://hermes-io-docs.vercel.app/)
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
This CLI is the official scaffolding generator for [hermes-io](https://www.npmjs.com/package/hermes-io#get-started), its generates a simple folder structure that guaranty separation of concerns encompassing pivotal elements such as: [contexts](https://github.com/Maxtermax/hermes-io#context), [hooks](https://github.com/Maxtermax/hermes-io#useobserver-hook) and [observers](https://github.com/Maxtermax/hermes-io#observer).
|
|
11
|
+
## Devtool
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
npm i hermes-io-cli -g
|
|
15
|
-
```
|
|
13
|
+
Install from chrome web store [here](https://chrome.google.com/webstore/detail/hermes-io/pjdkgcpikfmkncldipldmimanfkpeedm?hl=en)
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
## Contributing:
|
|
21
20
|
|
|
22
|
-

|
|
23
|
-
|
|
24
|
-
## Contributing:
|
|
25
21
|
Feel free to open a PR explaining your changes, this library is open to suggestions and improvements.
|
|
26
22
|
|
|
27
23
|
https://github.com/Maxtermax/hermes-io
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _array_like_to_array(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}import{useState as r,useRef as t}from"react";import{useObserver as e}from"../hooks/useObserver";export var useMutations=function(n){var o=n.store,a=n.id,i=n.events,l=n.noUpdate,u=void 0!==l&&l,v=n.onChange,
|
|
1
|
+
function _array_like_to_array(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}import{useState as r,useRef as t}from"react";import{useObserver as e}from"../hooks/useObserver";var randomId=function(){var r,t;return(null==(t=crypto)?void 0:null==(r=t.randomUUID)?void 0:r.call(t))||Math.random().toString(36).substring(2,16)};export var useMutations=function(n){var o=n.store,a=n.id,i=n.events,l=n.noUpdate,u=void 0!==l&&l,v=n.onChange,d=r(randomId()),s=(d[0],d[1]),c=t(null);return e({listener:function(r,t){for(var e,n=function(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(e)return(e=e.call(r)).next.bind(e);if(Array.isArray(r)||(e=function(r,t){if(r){if("string"==typeof r)return _array_like_to_array(r,void 0);var e=Object.prototype.toString.call(r).slice(8,-1);if("Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return _array_like_to_array(r,void 0)}}(r))){e&&(r=e);var n=0;return function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(i);!(e=n()).done;){var o=e.value;if(r.value.type===o){var l,d,c=null==(d=r.value)?void 0:null==(l=d.payload)?void 0:l.value;(!r.value.targets||r.value.targets.includes(a))&&!1===u&&s(randomId()),null==v||v(c,t)}}},contexts:[o.context],observer:o.observer}),c};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hermes-io",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.46",
|
|
4
4
|
"description": "A lightweight React library that allows communication between Reactjs components by using the observer pattern and the hook api",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.js",
|