DefinitelyTyped/types/redux-cablecar/redux-cablecar-tests.ts
Christoph Flick 4c52cecef4 Add types for redux-cablecar (#38944)
* Add types for redux-cablecar

* Make payload for the perform function optional
2019-10-10 16:26:17 -07:00

19 lines
499 B
TypeScript

import cablecar, { Options } from 'redux-cablecar';
import { applyMiddleware, createStore } from 'redux';
const store = createStore(() => null, applyMiddleware(cablecar));
cablecar.setProvider('testProvider');
const car = cablecar.connect(store, 'testChannel');
const options: Options = {
connected: () => { },
prefix: 'ASDF'
};
const anotherCar = cablecar.connect(store, 'secondeTestChannel', options);
car.perform('activate', { data: 'something' });
anotherCar.send('noice_action');