| 73 | } |
| 74 | |
| 75 | async onOpen() { |
| 76 | // Send all queued messages. |
| 77 | for (const message of this.messageQueue) { |
| 78 | this.socket.send(JSON.stringify(message)); |
| 79 | } |
| 80 | this.messageQueue = []; |
| 81 | // useful side effect: onStoreUpdate will be called |
| 82 | this.store.dispatch(connectionActions.startFetching()); |
| 83 | await Promise.all([ |
| 84 | this.fetchData(Resource.State), |
| 85 | this.fetchData(Resource.Flows), |
| 86 | this.fetchData(Resource.Events), |
| 87 | this.fetchData(Resource.Options), |
| 88 | ]); |
| 89 | this.store.dispatch(connectionActions.finishFetching()); |
| 90 | } |
| 91 | |
| 92 | onStoreUpdate() { |
| 93 | const storeFilterState = this.store.getState().ui.filter; |