/
githubmirror
/
react-native
Обзор
Документация
Войти
/
githubmirror
/
react-native
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/rn-tester/IntegrationTests/LoggingTestModule.js
37 строк
957 B
Tim Yung
RN: Flowify `packages/rn-tester` (#51788)
04 июн 2025, 22:03
04 июн 2025, 22:03
3e6423f
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict-local * @format */ import invariant from 'invariant'; import BatchedBridge from 'react-native/Libraries/BatchedBridge/BatchedBridge'; const LoggingTestModule = { logToConsole(message: string): void { console.log(message); }, logToConsoleAfterWait(message: string, delay: number): void { setTimeout(function () { console.log(message); }, delay); }, warning(message: string): void { console.warn(message); }, invariant(message: string): void { invariant(false, message); }, logErrorToConsole(message: string): void { console.error(message); }, throwError(message: string): void { throw new Error(message); }, }; BatchedBridge.registerCallableModule('LoggingTestModule', LoggingTestModule);