(
q: any,
cb: SyncTableCallback<any, any, any>,
)
| 479 | } |
| 480 | |
| 481 | public subscribe( |
| 482 | q: any, |
| 483 | cb: SyncTableCallback<any, any, any>, |
| 484 | ): ( |
| 485 | opts?: { keepSubscription?: boolean | null | undefined } | null | undefined, |
| 486 | ) => void { |
| 487 | const hash = weakHash(q); |
| 488 | this.callbacks[hash] = this.callbacks[hash] || []; |
| 489 | this.callbacks[hash].push(cb); |
| 490 | |
| 491 | this.initSubscription(q, hash, cb); |
| 492 | |
| 493 | return (opts?: { keepSubscription?: boolean | null | undefined }) => { |
| 494 | this.unsubscribe(hash, cb, opts?.keepSubscription); |
| 495 | }; |
| 496 | } |
| 497 | |
| 498 | private unsubscribe( |
| 499 | hash: string, |
no test coverage detected