/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
v19.1.0
packages/react-client/src/ReactFlightClientStreamConfigNode.js
32 строки
692 B
Sebastian Markbåge
Rename default FlightClientConfigs to FlightClientStreamConfig (#28382)
20 фев 2024, 22:24
Не верифицирован
20 фев 2024, 22:24
8f01226
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and 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 {TextDecoder} from 'util'; export type StringDecoder = TextDecoder; 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); }