@fedeghe/pangjs 0.0.5 → 0.0.6

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.
Files changed (3) hide show
  1. package/README.md +13 -14
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # PANGjs (0.0.5)
1
+ # PANGjs (0.0.6)
2
2
 
3
3
  ![alt text](https://github.com/fedeghe/pangjs/blob/main/pangjs.png?raw=true "Pang js")
4
4
 
@@ -29,16 +29,15 @@ const store = PANGjs.getStore( reducer, initState );
29
29
 
30
30
  // stage the results only internally
31
31
  store.stage({
32
- type: 'ADD',
33
- payload: { number: 4 }
34
- })
35
- .then(s => console.log(
36
- 'here we get the unpushed state:', s
37
- ));
32
+ type: 'ADD',
33
+ payload: { number: 4 }
34
+ })
35
+ // here we get staged state
36
+ .then(console.log);
38
37
 
39
38
  // make all staged changes effective
40
39
  store.dispatch()
41
- // here we get the pushed state
40
+ // here we get the state
42
41
  .then(console.log);
43
42
  ```
44
43
  alternatively one single call just adding `true` as second parameter also dispatch:
@@ -47,10 +46,10 @@ store.stage({
47
46
  type: 'ADD',
48
47
  payload: { number: 4 }
49
48
  }, true /* autoDispatch */)
50
- .then(console.log); // here we get autopushed state
49
+ .then(console.log); // here we get the state
51
50
  ```
52
51
 
53
- alternatively it is possible to directly push the action:
52
+ alternatively it is possible to directly dispatch the action:
54
53
  ``` js
55
54
  store.dispatch({
56
55
  type: 'ADD',
@@ -129,9 +128,9 @@ Every store obtained invoking successfully `PANGjs.getStore` exposes the followi
129
128
 
130
129
  ### `storeInstance.getState() -> state`
131
130
 
132
- returns the last pushed state
131
+ returns the state
133
132
 
134
- ### `storeInstance.stage(action, autoPush) -> Promise`
133
+ ### `storeInstance.stage(action, autoDispatch) -> Promise`
135
134
 
136
135
  stage or stage&dispatch returning a promise resolving with new state (staged or not);
137
136
 
@@ -143,7 +142,7 @@ stage or stage&dispatch returning a promise resolving with new state (staged or
143
142
  payload: <Object>
144
143
  }
145
144
  ```
146
- - autoPush `<Boolean>` default `false`
145
+ - autoDispatch `<Boolean>` default `false`
147
146
 
148
147
 
149
148
 
@@ -161,7 +160,7 @@ and as
161
160
 
162
161
  ### `storeInstance.subscribe(fn) -> unsubscribing function`
163
162
 
164
- allows to register a subscribing function that will be invoked everytime the state changes (pushed)
163
+ allows to register a subscribing function that will be invoked everytime the state changes (dispatched)
165
164
 
166
165
  **returns**: the unsubscribing function
167
166
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  /*
3
3
  PANGjs
4
- v. 0.0.5
4
+ v. 0.0.6
5
5
 
6
6
  Size: ~3.79KB
7
7
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedeghe/pangjs",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "main": "dist/index.js",
5
5
  "author": "fedeghe <fedeghe@gmail.com>",
6
6
  "description": "Lightweight asynchronous state manager",