Files
DefinitelyTyped/types/redux-socket.io/redux-socket.io-tests.ts
Igor Snake 68e71f0c21 Added redux-socket.io type (#22773)
* Added redux-socket.io type

* Fixed bad dependency on socket.io
2018-01-10 10:29:28 -08:00

11 lines
535 B
TypeScript

import * as ioclient from 'socket.io-client';
import createSocketIoMiddleware from 'redux-socket.io';
import { Action } from 'redux';
const socketio = ioclient("test");
const SocketIOMiddleware1 = createSocketIoMiddleware(socketio, "test");
const SocketIOMiddleware2 = createSocketIoMiddleware(socketio, ["test1", "test2"]);
const SocketIOMiddleware3 = createSocketIoMiddleware(socketio, (type: string, action: Action) => (type === 'test'));
const SocketIOMiddleware4 = createSocketIoMiddleware(socketio, "", { eventName: "test" });