on 703ff86 help sign in
bridge/src/lib/state.js
36 lines 518 B history raw
1const invert = (key, state) => {
2 return {
3 [key]: !state[key],
4 };
5};
7// const invert = (state, key) => {
8// return {
9// [key]: !state[key],
10// }
11// };
13const toTrue = key => {
14 return {
15 [key]: true,
16 };
17};
19const toFalse = key => {
20 return {
21 [key]: false,
22 };
23};
25const toNull = key => {
26 return {
27 [key]: false,
28 };
29};
31// const chain = (context, key, data, ...fs) => {
32// fs.forEach(f => f());
33// context.setState({[k]: data});
34// };
36export { invert, toTrue, toFalse, toNull };