-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EventEmitter C++ bridging type #44808
Conversation
This pull request was exported from Phabricator. Differential Revision: D57424391 |
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
b4a201a
to
d56e25f
Compare
This pull request was exported from Phabricator. Differential Revision: D57424391 |
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
d56e25f
to
359d333
Compare
This pull request was exported from Phabricator. Differential Revision: D57424391 |
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
Base commit: 53dda9e |
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
359d333
to
840b191
Compare
This pull request was exported from Phabricator. Differential Revision: D57424391 |
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
840b191
to
1aa93e0
Compare
This pull request was exported from Phabricator. Differential Revision: D57424391 |
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
1aa93e0
to
60c70ad
Compare
This pull request was exported from Phabricator. Differential Revision: D57424391 |
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
Summary: Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Differential Revision: D57424391
This pull request was exported from Phabricator. Differential Revision: D57424391 |
60c70ad
to
c1ce102
Compare
Summary: Pull Request resolved: facebook#44808 Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Reviewed By: javache Differential Revision: D57424391
This pull request was exported from Phabricator. Differential Revision: D57424391 |
c1ce102
to
a7ea167
Compare
Summary: Pull Request resolved: facebook#44808 Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Reviewed By: javache Differential Revision: D57424391
This pull request was exported from Phabricator. Differential Revision: D57424391 |
a7ea167
to
aa73b29
Compare
Summary: Pull Request resolved: facebook#44808 Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Reviewed By: javache Differential Revision: D57424391
Summary: Pull Request resolved: facebook#44808 Adds an `AsyncEventEmitter` class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript. Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought. It implements this interface ``` export type EventEmitter<T> = { addListener(handler: (T) => mixed): EventSubscription, }; ``` ## Hybrid It is a 'hybrid' object. 1.) You `addListener(handler: (T) => mixed)` in JavaScript for emitted events (coming from C++, native code) 2.) You `emit(...Arg)` events in C++, native code (getting sent to JavaScript) ## Changelog: [General] [Added] - Add EventEmitter C++ bridging type ## Facebook: Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h Reviewed By: javache Differential Revision: D57424391
This pull request was exported from Phabricator. Differential Revision: D57424391 |
aa73b29
to
e9062c6
Compare
This pull request has been merged in 2a0a112. |
This pull request was successfully merged by @christophpurrer in 2a0a112. When will my fix make it into a release? | How to file a pick request? |
Summary:
Adds an
AsyncEventEmitter
class which can be used as a property of currently C++ only Turbo Modules to send type safe data back to JavaScript.Adding support for ObjC / Java Turbo Modules is possible, straight forward and can be added as an afterthought.
It implements this interface
Hybrid
It is a 'hybrid' object.
1.) You
addListener(handler: (T) => mixed)
in JavaScript for emitted events (coming from C++, native code)2.) You
emit(...Arg)
events in C++, native code (getting sent to JavaScript)Changelog:
[General] [Added] - Add EventEmitter C++ bridging type
Facebook:
Apps usually create custom functionality to achieve this kind of behavior - e.g. https://www.internalfb.com/code/fbsource/[e72bd42a028a]/arvr/js/apps/RemoteDesktopCompanion/shared/turbo_modules/TMSubscription.h
Differential Revision: D57424391