Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

threadFindActionBus.ts

10 lines381 Bytes

1const THREAD_FIND_OPEN_EVENT = "t3:thread-find-open";
2​
3export function requestThreadFindOpen(): void {
4 window.dispatchEvent(new Event(THREAD_FIND_OPEN_EVENT));
5}
6​
7export function subscribeThreadFindOpen(listener: () => void): () => void {
8 window.addEventListener(THREAD_FIND_OPEN_EVENT, listener);
9 return () => window.removeEventListener(THREAD_FIND_OPEN_EVENT, listener);