diff --git a/src/fb-stubs/Prefetcher.js b/src/fb-stubs/Prefetcher.js new file mode 100644 index 000000000..a22293de3 --- /dev/null +++ b/src/fb-stubs/Prefetcher.js @@ -0,0 +1,8 @@ +/** + * Copyright 2018-present Facebook. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * @format + */ + +export default async function setupPrefetcher() {} diff --git a/src/init.js b/src/init.js index 62c0ec3c7..1e0b59909 100644 --- a/src/init.js +++ b/src/init.js @@ -13,6 +13,7 @@ import GK from './fb-stubs/GK.js'; import {init as initLogger} from './fb-stubs/Logger'; import App from './App.js'; import BugReporter from './fb-stubs/BugReporter.js'; +import setupPrefetcher from './fb-stubs/Prefetcher.js'; import {createStore} from 'redux'; import {persistStore} from 'redux-persist'; import reducers from './reducers/index.js'; @@ -68,6 +69,10 @@ function init() { initLauncherHooks(config(), store); const sessionId = store.getState().application.sessionId; initCrashReporter(sessionId || ''); + + requestIdleCallback(() => { + setupPrefetcher(); + }); } // rehydrate app state before exposing init