(mutation: Mutation<any, any, any, any>)
| 121 | } |
| 122 | |
| 123 | add(mutation: Mutation<any, any, any, any>): void { |
| 124 | this.#mutations.add(mutation) |
| 125 | const scope = scopeFor(mutation) |
| 126 | if (typeof scope === 'string') { |
| 127 | const scopedMutations = this.#scopes.get(scope) |
| 128 | if (scopedMutations) { |
| 129 | scopedMutations.push(mutation) |
| 130 | } else { |
| 131 | this.#scopes.set(scope, [mutation]) |
| 132 | } |
| 133 | } |
| 134 | this.notify({ type: 'added', mutation }) |
| 135 | } |
| 136 | |
| 137 | remove(mutation: Mutation<any, any, any, any>): void { |
| 138 | if (this.#mutations.delete(mutation)) { |