本文整理匯總了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();
};
}
示例2: registerBottomTabSelectedListener
public registerBottomTabSelectedListener(callback: (data: BottomTabSelectedEvent) => void): EmitterSubscription {
return this.emitter.addListener('RNN.BottomTabSelected', callback);
}
示例3: registerCommandCompletedListener
public registerCommandCompletedListener(callback: (data: CommandCompletedEvent) => void): EmitterSubscription {
return this.emitter.addListener('RNN.CommandCompleted', callback);
}
示例4: registerPreviewCompletedListener
public registerPreviewCompletedListener(callback: (event: PreviewCompletedEvent) => void): EmitterSubscription {
return this.emitter.addListener('RNN.PreviewCompleted', callback);
}
示例5: registerSearchBarCancelPressedListener
public registerSearchBarCancelPressedListener(callback: (event: SearchBarCancelPressedEvent) => void): EmitterSubscription {
return this.emitter.addListener('RNN.SearchBarCancelPressed', callback);
}
示例6: registerModalDismissedListener
public registerModalDismissedListener(callback: (event: ModalDismissedEvent) => void): EmitterSubscription {
return this.emitter.addListener('RNN.ModalDismissed', callback);
}
示例7: registerNavigationButtonPressedListener
public registerNavigationButtonPressedListener(callback: (event: NavigationButtonPressedEvent) => void): EmitterSubscription {
return this.emitter.addListener('RNN.NavigationButtonPressed', callback);
}
示例8: registerComponentDidDisappearListener
public registerComponentDidDisappearListener(callback: (event: ComponentDidDisappearEvent) => void): EmitterSubscription {
return this.emitter.addListener('RNN.ComponentDidDisappear', callback);
}
示例9: registerAppLaunchedListener
public registerAppLaunchedListener(callback: () => void): EmitterSubscription {
return this.emitter.addListener('RNN.AppLaunched', callback);
}