Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_handleMotion(motion) {
// TODO: Bacon: Can rotation be calculated?
SyntheticPlatformEmitter.emit('deviceMotionDidUpdate', {
acceleration: motion.acceleration,
accelerationIncludingGravity: motion.accelerationIncludingGravity,
interval: motion.interval,
rotationRate: motion.rotationRate,
orientation: window.orientation,
});
},
startObserving() {
async function emitOrientationEvent() {
const [orientationLock, orientationInfo] = await Promise.all([
getOrientationLockAsync(),
getOrientationAsync(),
]);
SyntheticPlatformEmitter.emit('expoDidUpdateDimensions', {
orientationLock,
orientationInfo,
});
}
message.onend = (nativeEvent) => {
SyntheticPlatformEmitter.emit('Exponent.speakingDone', { id, nativeEvent });
};
message.onpause = (nativeEvent) => {
message.onstart = (nativeEvent) => {
SyntheticPlatformEmitter.emit('Exponent.speakingStarted', { id, nativeEvent });
};
message.onend = (nativeEvent) => {
message.onerror = (nativeEvent: SpeechSynthesisErrorEvent) => {
SyntheticPlatformEmitter.emit('Exponent.speakingError', { id, nativeEvent });
};
message.onend = (nativeEvent: SpeechSynthesisEvent) => {
SyntheticPlatformEmitter.emit('Exponent.speakingDone', { id, nativeEvent });
};
message.onpause = (nativeEvent: SpeechSynthesisEvent) => {
async function emitOrientationEvent() {
const [orientationLock, orientationInfo] = await Promise.all([
getOrientationLockAsync(),
getOrientationAsync(),
]);
SyntheticPlatformEmitter.emit('expoDidUpdateDimensions', {
orientationLock,
orientationInfo,
});
}
if (canUseEventListeners) {
message.onpause = (nativeEvent) => {
SyntheticPlatformEmitter.emit('Exponent.speakingStopped', { id, nativeEvent });
};
message.onerror = (nativeEvent) => {
media.ontimeupdate = () => {
SyntheticPlatformEmitter.emit('didUpdatePlaybackStatus', {
key: media,
status: getStatusFromMedia(media),
});
};
message.onpause = (nativeEvent: SpeechSynthesisEvent) => {
SyntheticPlatformEmitter.emit('Exponent.speakingStopped', { id, nativeEvent });
};
message.onerror = (nativeEvent: SpeechSynthesisErrorEvent) => {