2018-06-15 11:25:16 -07:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2018-06-15 11:25:16 -07:00
|
|
|
*
|
|
|
|
* 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 {
|
|
|
|
|
2018-11-27 20:58:28 -08:00
|
|
|
void SwitchEventEmitter::onChange(bool value) const {
|
|
|
|
dispatchEvent("change", [value](jsi::Runtime &runtime) {
|
|
|
|
auto payload = jsi::Object(runtime);
|
|
|
|
payload.setProperty(runtime, "value", value);
|
|
|
|
return payload;
|
|
|
|
});
|
2018-06-15 11:25:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace react
|
|
|
|
} // namespace facebook
|