當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript react-native.EventEmitter類代碼示例

本文整理匯總了TypeScript中react-native.EventEmitter的典型用法代碼示例。如果您正苦於以下問題:TypeScript EventEmitter類的具體用法?TypeScript EventEmitter怎麽用?TypeScript EventEmitter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了EventEmitter類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: subscribeToPermissionUpdates

  public subscribeToPermissionUpdates(
    listener: (status: LocationPermissionStatus) => void
  ): Subscription {
    const emitterSubscription = this.eventEmitter.addListener(
      "authorizationStatusDidChange",
      listener
    );

    return () => {
      emitterSubscription.remove();
    };
  }
開發者ID:timfpark,項目名稱:react-native-location,代碼行數:12,代碼來源:permissions.ts

示例2: registerBottomTabSelectedListener

 public registerBottomTabSelectedListener(callback: (data: BottomTabSelectedEvent) => void): EmitterSubscription {
   return this.emitter.addListener('RNN.BottomTabSelected', callback);
 }
開發者ID:wix,項目名稱:react-native-navigation,代碼行數:3,代碼來源:NativeEventsReceiver.ts

示例3: registerCommandCompletedListener

 public registerCommandCompletedListener(callback: (data: CommandCompletedEvent) => void): EmitterSubscription {
   return this.emitter.addListener('RNN.CommandCompleted', callback);
 }
開發者ID:wix,項目名稱:react-native-navigation,代碼行數:3,代碼來源:NativeEventsReceiver.ts

示例4: registerPreviewCompletedListener

 public registerPreviewCompletedListener(callback: (event: PreviewCompletedEvent) => void): EmitterSubscription {
   return this.emitter.addListener('RNN.PreviewCompleted', callback);
 }
開發者ID:wix,項目名稱:react-native-navigation,代碼行數:3,代碼來源:NativeEventsReceiver.ts

示例5: registerSearchBarCancelPressedListener

 public registerSearchBarCancelPressedListener(callback: (event: SearchBarCancelPressedEvent) => void): EmitterSubscription {
   return this.emitter.addListener('RNN.SearchBarCancelPressed', callback);
 }
開發者ID:wix,項目名稱:react-native-navigation,代碼行數:3,代碼來源:NativeEventsReceiver.ts

示例6: registerModalDismissedListener

 public registerModalDismissedListener(callback: (event: ModalDismissedEvent) => void): EmitterSubscription {
   return this.emitter.addListener('RNN.ModalDismissed', callback);
 }
開發者ID:wix,項目名稱:react-native-navigation,代碼行數:3,代碼來源:NativeEventsReceiver.ts

示例7: registerNavigationButtonPressedListener

 public registerNavigationButtonPressedListener(callback: (event: NavigationButtonPressedEvent) => void): EmitterSubscription {
   return this.emitter.addListener('RNN.NavigationButtonPressed', callback);
 }
開發者ID:wix,項目名稱:react-native-navigation,代碼行數:3,代碼來源:NativeEventsReceiver.ts

示例8: registerComponentDidDisappearListener

 public registerComponentDidDisappearListener(callback: (event: ComponentDidDisappearEvent) => void): EmitterSubscription {
   return this.emitter.addListener('RNN.ComponentDidDisappear', callback);
 }
開發者ID:wix,項目名稱:react-native-navigation,代碼行數:3,代碼來源:NativeEventsReceiver.ts

示例9: registerAppLaunchedListener

 public registerAppLaunchedListener(callback: () => void): EmitterSubscription {
   return this.emitter.addListener('RNN.AppLaunched', callback);
 }
開發者ID:wix,項目名稱:react-native-navigation,代碼行數:3,代碼來源:NativeEventsReceiver.ts


注:本文中的react-native.EventEmitter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。