Return an observable that can be used to subscribe to all errors happening in the thread.
(thread: ThreadT)
| 12 | export const Thread = { |
| 13 | /** Return an observable that can be used to subscribe to all errors happening in the thread. */ |
| 14 | errors<ThreadT extends ThreadType>(thread: ThreadT): Observable<Error> { |
| 15 | return thread[$errors] || fail("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.") |
| 16 | }, |
| 17 | /** Return an observable that can be used to subscribe to internal events happening in the thread. Useful for debugging. */ |
| 18 | events<ThreadT extends ThreadType>(thread: ThreadT): Observable<WorkerEvent> { |
| 19 | return thread[$events] || fail("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise.") |