INNER CODE UNIT · JavaScript

ShareReceivedListener

zulip/zulip-mobile · src/sharing/index.js:25

export class ShareReceivedListener {
  unsubs: Array<() => void> = [];

  /** Private. */
  listen(name: string, handler: (...empty) => void | Promise<void>) {
    if (Platform.OS === 'android') {
      const subscription = DeviceEventEmitter.addListener(name, handler);
      this.unsubs.push(() => subscription.remove());
    }
  }

  /** Private. */
  unlistenAll() {
    while (this.unsubs.length > 0) {
      this.unsubs.pop()();
    }
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…