()
| 33 | |
| 34 | // Notifies all subscribed components about a state change. |
| 35 | const broadcast = () => { |
| 36 | listeners.forEach(listener => listener(state)); |
| 37 | }; |
| 38 | |
| 39 | const setState = (newState: Partial<PullState>) => { |
| 40 | state = { ...state, ...newState }; |