Files
react/packages/react-flight-dom-relay/src/ReactFlightDOMRelayServerHostConfig.js
Sebastian Markbåge bdc5cc4635 Add Relay Flight Build (#18242)
* Rename to clarify that it's client-only

* Rename FizzStreamer to FizzServer for consistency

* Rename react-flight to react-client/flight

For consistency with react-server. Currently this just includes flight
but it could be expanded to include the whole reconciler.

* Add Relay Flight Build

* Rename ReactServerHostConfig to ReactServerStreamConfig

This will be the config specifically for streaming purposes.
There will be other configs for other purposes.
2020-03-07 11:23:30 -08:00

35 lines
831 B
JavaScript

/**
* 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 Destination = Array<string>;
export function scheduleWork(callback: () => void) {
callback();
}
export function flushBuffered(destination: Destination) {}
export function beginWriting(destination: Destination) {}
export function writeChunk(
destination: Destination,
buffer: Uint8Array,
): boolean {
destination.push(Buffer.from((buffer: any)).toString('utf8'));
return true;
}
export function completeWriting(destination: Destination) {}
export function close(destination: Destination) {}
export function convertStringToBuffer(content: string): Uint8Array {
return Buffer.from(content, 'utf8');
}