/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-noop-renderer/npm/flight-modules.js
16 строк
444 B
Sebastian Markbåge
[Flight] Integrate Blocks into Flight (#18371)
24 мар 2020, 03:53
Не верифицирован
24 мар 2020, 03:53
a56309f
Код
Авторство
О чём код?
'use strict'; // This file is used as temporary storage for modules generated in Flight tests. var moduleIdx = 0; var modules = new Map(); // This simulates what the compiler will do when it replaces render functions with server blocks. exports.saveModule = function saveModule(render) { var idx = '' + moduleIdx++; modules.set(idx, render); return idx; }; exports.readModule = function readModule(idx) { return modules.get(idx); };