mirror of
https://github.com/status-im/react-native.git
synced 2025-02-24 07:08:27 +00:00
Summary: Pretty straight-forward migration to using `JSI` instead of `folly::dynamic` in SwitchEventEmitter. Reviewed By: sahrens Differential Revision: D13123046 fbshipit-source-id: f2e4905a96191540ceec633bae1871c93be724db
23 lines
541 B
C++
23 lines
541 B
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "SwitchEventEmitter.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
void SwitchEventEmitter::onChange(bool value) const {
|
|
dispatchEvent("change", [value](jsi::Runtime &runtime) {
|
|
auto payload = jsi::Object(runtime);
|
|
payload.setProperty(runtime, "value", value);
|
|
return payload;
|
|
});
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|