on 616e621 help sign in
bridge/src/lib/state.js
48 lines 529 B history raw
3const invert = (key, state) => {
4 return {
5 [key]: !state[key],
6 }
7};
10// const invert = (state, key) => {
11// return {
12// [key]: !state[key],
13// }
14// };
17const toTrue = key => {
18 return {
19 [key]: true,
20 }
21};
23const toFalse = key => {
24 return {
25 [key]: false,
26 }
27};
29const toNull = key => {
30 return {
31 [key]: false,
32 }
33};
36// const chain = (context, key, data, ...fs) => {
37// fs.forEach(f => f());
38// context.setState({[k]: data});
39// };
43export {
44 invert,
45 toTrue,
46 toFalse,
47 toNull,