// Copyright (c) 2004-present, Facebook, Inc. // 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 #include #include #include #include #include #include namespace facebook { namespace react { class JSDeltaBundleClient { public: void patch(const folly::dynamic& delta); JSModulesUnbundle::Module getModule(uint32_t moduleId) const; std::unique_ptr getStartupCode() const; void clear(); private: std::unordered_map modules_; std::string startupCode_; }; class JSDeltaBundleClientRAMBundle : public JSModulesUnbundle { public: JSDeltaBundleClientRAMBundle( std::shared_ptr client) : client_(client) {} Module getModule(uint32_t moduleId) const override { return client_->getModule(moduleId); } private: const std::shared_ptr client_; }; } // namespace react } // namespace facebook