2022-11-28 10:52:24 +00:00
|
|
|
// @ts-expect-error
|
2020-05-20 10:57:03 +00:00
|
|
|
import { Transport } from '../../../modules/transport';
|
|
|
|
|
2019-07-12 13:08:34 +00:00
|
|
|
import {
|
|
|
|
SET_TRANSPORT,
|
|
|
|
SUSPEND_DETECTED
|
|
|
|
} from './actionTypes';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signals that suspend was detected.
|
|
|
|
*
|
|
|
|
* @public
|
|
|
|
* @returns {{
|
|
|
|
* type: SUSPEND_DETECTED
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function suspendDetected() {
|
|
|
|
return {
|
|
|
|
type: SUSPEND_DETECTED
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signals setting of a transport.
|
|
|
|
*
|
|
|
|
* @param {Transport} transport - The transport to save in the state.
|
|
|
|
* @returns {{
|
|
|
|
* transport: Transport,
|
|
|
|
* type: string
|
|
|
|
* }}
|
|
|
|
*/
|
2022-11-28 10:52:24 +00:00
|
|
|
export function setTransport(transport?: Transport) {
|
2019-07-12 13:08:34 +00:00
|
|
|
return {
|
|
|
|
type: SET_TRANSPORT,
|
|
|
|
transport
|
|
|
|
};
|
|
|
|
}
|