UNPKG
@stormid/tabs
Version:
latest (1.0.0)
1.0.0
1.0.0-alpha.15
1.0.0-alpha.14
1.0.0-alpha.12
1.0.0-alpha.11
1.0.0-alpha.10
1.0.0-alpha.9
1.0.0-alpha.8
1.0.0-alpha.7
1.0.0-alpha.6
1.0.0-alpha.5
1.0.0-alpha.4
1.0.0-alpha.3
Accessible tabbed panelled content areas
@stormid/tabs
/
src
/
lib
/
store.js
13 lines
(10 loc)
•
315 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
export
const
createStore
= (
) => {
let
state = {};
const
getState
= (
) => state;
const
update
= (
nextState, effects
) => { state = nextState ?? state;
if
(!effects)
return
; effects.
forEach
(
effect
=>
effect
(state)); };
return
{ update, getState }; };