(action)
| 76 | const listeners = []; |
| 77 | let memoryState = { toasts: [] }; |
| 78 | function dispatch(action) { |
| 79 | memoryState = reducer(memoryState, action); |
| 80 | listeners.forEach((listener) => { |
| 81 | listener(memoryState); |
| 82 | }); |
| 83 | } |
| 84 | function toast({ ...props }) { |
| 85 | const id = genId(); |
| 86 | const update = (props2) => dispatch({ |