Comparing version 0.4.30 to 0.4.31
{ | ||
"name": "realar", | ||
"version": "0.4.30", | ||
"version": "0.4.31", | ||
"description": "React state manager", | ||
@@ -88,3 +88,3 @@ "repository": { | ||
}, | ||
"gitHead": "7c9e712659544f676aa1d32aa593cbd94148e00e" | ||
"gitHead": "4cbe32d9b59f6e6f246e0f1ccd097d327e81e0e6" | ||
} |
@@ -97,34 +97,2 @@ # Realar | ||
### Actions | ||
The `action` allows you to trigger an event and delivers the functionality to subscribe to it anywhere in your application code. | ||
```javascript | ||
const add = action(); | ||
const [get, set] = box(1); | ||
on(add, num => set(get() + num)); | ||
add(15); | ||
console.log(get()); // 16 | ||
``` | ||
[Edit on RunKit](https://runkit.com/betula/6013af7649e8720019c9cf2a) | ||
An action is convenient to use as a promise. | ||
```javascript | ||
const fire = action(); | ||
const listen = async () => { | ||
for (;;) { | ||
await fire; // await as a usual promise | ||
console.log('Fire'); | ||
} | ||
} | ||
listen(); | ||
setInterval(fire, 500); | ||
``` | ||
[Edit on RunKit](https://runkit.com/betula/601e3b0056b62d001bfa391b) | ||
### Access visibility levels | ||
@@ -179,2 +147,34 @@ | ||
### Actions | ||
The `action` allows you to trigger an event and delivers the functionality to subscribe to it anywhere in your application code. | ||
```javascript | ||
const add = action(); | ||
const [get, set] = box(1); | ||
on(add, num => set(get() + num)); | ||
add(15); | ||
console.log(get()); // 16 | ||
``` | ||
[Edit on RunKit](https://runkit.com/betula/6013af7649e8720019c9cf2a) | ||
An action is convenient to use as a promise. | ||
```javascript | ||
const fire = action(); | ||
const listen = async () => { | ||
for (;;) { | ||
await fire; // await as a usual promise | ||
console.log('Fire'); | ||
} | ||
} | ||
listen(); | ||
setInterval(fire, 500); | ||
``` | ||
[Edit on RunKit](https://runkit.com/betula/601e3b0056b62d001bfa391b) | ||
### Core | ||
@@ -181,0 +181,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package