/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
v18.2.0
packages/react-server-native-relay/src/ReactFlightNativeRelayClient.js
37 строк
1 KB
Sebastian Markbåge
[Flight] Rename react-transport-... packages to react-server-... (#20403)
08 дек 2020, 16:08
Не верифицирован
08 дек 2020, 16:08
5fd9db7
Код
Авторство
О чём код?
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import type {RowEncoding} from './ReactFlightNativeRelayProtocol'; import type {Response} from 'react-client/src/ReactFlightClient'; import { createResponse, resolveModel, resolveModule, resolveSymbol, resolveError, close, } from 'react-client/src/ReactFlightClient'; export {createResponse, close}; export function resolveRow(response: Response, chunk: RowEncoding): void { if (chunk[0] === 'J') { resolveModel(response, chunk[1], chunk[2]); } else if (chunk[0] === 'M') { resolveModule(response, chunk[1], chunk[2]); } else if (chunk[0] === 'S') { // $FlowFixMe: Flow doesn't support disjoint unions on tuples. resolveSymbol(response, chunk[1], chunk[2]); } else { // $FlowFixMe: Flow doesn't support disjoint unions on tuples. resolveError(response, chunk[1], chunk[2].message, chunk[2].stack); } }