Summary: Using `process.exit()` stops the node process without waiting for the event loop to finish, so when using async i/o, which is what happens when piped, if the output is buffered, the process can terminate before it finishes flushing the buffer. This means you only get some of the output and the JSON is malformed. This fixes it by calling `process.exit()` inside the flushed callback. Reviewed By: passy Differential Revision: D15624806 fbshipit-source-id: ea540ed5a40fb1811e5b705b190da96c8e54730d
11 lines
365 B
JavaScript
11 lines
365 B
JavaScript
/**
|
|
* Copyright 2018-present Facebook.
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
* @format
|
|
*/
|
|
import type {Store} from '../reducers/index.js';
|
|
import type {Logger} from '../fb-interfaces/Logger';
|
|
|
|
export type Dispatcher = (store: Store, logger: Logger) => ?() => Promise<void>;
|