Changeset View
Changeset View
Standalone View
Standalone View
lib/socket/api-request-handler.react.js
// @flow | // @flow | ||||
import invariant from 'invariant'; | import invariant from 'invariant'; | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { InflightRequests, SocketOffline } from './inflight-requests.js'; | import { InflightRequests } from './inflight-requests.js'; | ||||
import type { APIRequest } from '../types/endpoints.js'; | import type { APIRequest } from '../types/endpoints.js'; | ||||
import { | import { | ||||
clientSocketMessageTypes, | clientSocketMessageTypes, | ||||
serverSocketMessageTypes, | serverSocketMessageTypes, | ||||
type ClientSocketMessageWithoutID, | type ClientSocketMessageWithoutID, | ||||
type ConnectionInfo, | type ConnectionInfo, | ||||
} from '../types/socket-types.js'; | } from '../types/socket-types.js'; | ||||
import { registerActiveSocket } from '../utils/action-utils.js'; | import { registerActiveSocket } from '../utils/action-utils.js'; | ||||
import { SocketOffline } from '../utils/errors.js'; | |||||
import { useSelector } from '../utils/redux-utils.js'; | import { useSelector } from '../utils/redux-utils.js'; | ||||
type BaseProps = { | type BaseProps = { | ||||
+inflightRequests: ?InflightRequests, | +inflightRequests: ?InflightRequests, | ||||
+sendMessage: (message: ClientSocketMessageWithoutID) => number, | +sendMessage: (message: ClientSocketMessageWithoutID) => number, | ||||
}; | }; | ||||
type Props = { | type Props = { | ||||
...BaseProps, | ...BaseProps, | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |