/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCxxPlatform/react/utils/PlatformRunLoopObserver.h
46 строк
1 KB
Andrew Datsenko
move rncxx utils (#50668)
12 апр 2025, 00:35
12 апр 2025, 00:35
0479145
Код
Авторство
О чём код?
/* * 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. */ #pragma once #include <react/utils/RunLoopObserver.h> #include <functional> #include <utility> namespace facebook::react { class PlatformRunLoopObserver; class PlatformRunLoopObserver : public RunLoopObserver { public: PlatformRunLoopObserver( RunLoopObserver::Activity activities, const RunLoopObserver::WeakOwner& owner) : RunLoopObserver(activities, owner) {} ~PlatformRunLoopObserver() override = default; PlatformRunLoopObserver(PlatformRunLoopObserver& other) = delete; PlatformRunLoopObserver& operator=(PlatformRunLoopObserver& other) = delete; PlatformRunLoopObserver(PlatformRunLoopObserver&& other) = delete; PlatformRunLoopObserver& operator=(PlatformRunLoopObserver&& other) = delete; bool isOnRunLoopThread() const noexcept override { return false; } void onRender() const noexcept { if (auto owner = owner_.lock()) { activityDidChange(activities_); } } private: void startObserving() const noexcept override {} void stopObserving() const noexcept override {} }; } // namespace facebook::react