/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
v16.13.0
packages/react-flight/src/ReactFlightHostConfigBrowser.js
34 строки
774 B
Sebastian Markbåge
[Flight] Move Flight DOM to a Webpack Specific Package (#17372)
15 ноя 2019, 22:46
Не верифицирован
15 ноя 2019, 22:46
39dbb14
Код
Авторство
О чём код?
/** * 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 */ export type Source = Promise<Response> | ReadableStream | XMLHttpRequest; export type StringDecoder = TextDecoder; export const supportsBinaryStreams = true; export function createStringDecoder(): StringDecoder { return new TextDecoder(); } const decoderOptions = {stream: true}; export function readPartialStringChunk( decoder: StringDecoder, buffer: Uint8Array, ): string { return decoder.decode(buffer, decoderOptions); } export function readFinalStringChunk( decoder: StringDecoder, buffer: Uint8Array, ): string { return decoder.decode(buffer); }