mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
0e10ee6ac6
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39717 AsyncCallback is a better abstraction than the current usage of WeakCallbackWrapper and RAIICallbackWrapperDestroyer, and has way fewer gotchas. Making a few changes here to make it easier to use in various scenarios and match the behaviour we're already seeing in CallbackWrapper. 1) Remove the explicit copy constructor, since this prevents an automatic move constructor from being generated 2) Add a call variant which takes a lambda, for callers which need to manually create JSI arguments 3) Ignore AsyncCallback invocations when the underlying runtime has gone away. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D49684248 fbshipit-source-id: 8b49ec22cc409572ead80a85b10a190994bf0dd5