Move async work out of the Server constructor
Summary: I feel like doing async stuff here isn't a good idea in general. But more pressingly, it means you can't immediately call server.close() after new Server(), because the things to close haven't been created yet. Reviewed By: danielbuechele Differential Revision: D10488301 fbshipit-source-id: 76ebe91e0c09f353e0bdb9f2e4116757e757abb2
This commit is contained in:
committed by
Facebook Github Bot
parent
086ab0188b
commit
764cdfe127
@@ -13,6 +13,7 @@ import type Client from '../Client.js';
|
||||
|
||||
export default (store: Store, logger: Logger) => {
|
||||
const server = new Server(logger, store);
|
||||
server.init();
|
||||
|
||||
server.addListener('new-client', (client: Client) => {
|
||||
store.dispatch({
|
||||
|
||||
Reference in New Issue
Block a user