Skip to content

Commit 471c57a

Browse files
authored
Refac onChange event arg of State Containers (#108)
* onChangeBinder * onChangeProp * first try with Active * write failing tests * rewrite all components' onChange * update onChange docs * fix flow types
1 parent 828adeb commit 471c57a

38 files changed

+123
-66
lines changed

.size-snapshot.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"dist/react-powerplug.umd.js": {
3-
"bundled": 23332,
4-
"minified": 9312,
5-
"gzipped": 2536
3+
"bundled": 23340,
4+
"minified": 9379,
5+
"gzipped": 2578
66
},
77
"dist/react-powerplug.cjs.js": {
8-
"bundled": 20402,
9-
"minified": 10586,
10-
"gzipped": 2413
8+
"bundled": 20442,
9+
"minified": 10525,
10+
"gzipped": 2470
1111
},
1212
"dist/react-powerplug.esm.js": {
13-
"bundled": 19740,
14-
"minified": 10026,
15-
"gzipped": 2275,
13+
"bundled": 19780,
14+
"minified": 9965,
15+
"gzipped": 2334,
1616
"treeshaked": {
1717
"rollup": {
1818
"code": 365,

docs/components/Active.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ import { Active } from 'react-powerplug'
1919

2020
## Active Props
2121

22-
_Don't have props_
22+
**onChange** _(optional)_
23+
The onChange event of the Active is called whenever the isActive state changes.
2324

2425
## Active Children Props
2526

docs/components/Counter.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ import { Counter } from 'react-powerplug'
2626
Specifies the initial count state, must be an number.
2727
By default, the initial count state is 0.
2828

29+
**onChange** _(optional)_
30+
The onChange event of the Counter is called whenever the count state changes.
31+
2932
## Counter Children Props
3033

3134
TL;DR: `{ count, inc, dec }`

docs/components/Focus.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import { Focus } from 'react-powerplug'
2020

2121
## Focus Props
2222

23-
_Don't have props_
23+
**onChange** _(optional)_
24+
The onChange event of the Focus is called whenever the isFocused state changes.
2425

2526
## Focus Children Props
2627

docs/components/Hover.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ import { Hover } from 'react-powerplug'
1919

2020
## Hover Props
2121

22-
_Don't have props_
22+
**onChange** _(optional)_
23+
The onChange event of the Hover is called whenever the isHovered state changes.
2324

2425
## Hover Children Props
2526

docs/components/Input.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import { Input } from 'react-powerplug'
2424
Specifies the initial value state.
2525
By default, the initial count state is an empty string.
2626

27+
**onChange** _(optional)_
28+
The onChange event of the Input is called whenever the value state changes.
29+
2730
## Input Children Props
2831

2932
TL;DR: `{ value, set, bind }`

docs/components/List.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Specifies the initial list state, must be an array.
2828
By default, the initial list state is an empty array.
2929

3030
**onChange** _(optional)_
31-
Callback that fires when state changes.
31+
The onChange event of the List is called whenever the list state changes.
3232

3333
## List Children Props
3434

docs/components/Map.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ import { Map } from 'react-powerplug'
3333
Specifies the initial state, must be an object.
3434
By default, the initial count state is an empty object
3535

36+
**onChange** _(optional)_
37+
The onChange event of the Map is called whenever the state changes.
38+
3639
## Map Children Props
3740

3841
TL;DR: `{ values, set, get }`

docs/components/State.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ import { State } from 'react-powerplug'
2525
Specifies the initial state, must be an object.
2626
By default, the initial state is an empty object.
2727

28+
**onChange** _(optional)_
29+
The onChange event of the State is called whenever the state changes.
30+
2831
## State Children Props
2932

3033
TL;DR: `{ state, setState }`

docs/components/Toggle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Specifies the initial on state, must be an boolean.
1919
By default, the initial on state is false.
2020

2121
**onChange** _(optional)_
22-
Callback that fires when state changes.
22+
The onChange event of the Toggle is called whenever the on state changes.
2323

2424
## Toggle Children Props
2525

0 commit comments

Comments
 (0)