mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add type definitions for react-redux-epic * Require TS 2.6 * Add package.json * Trigger CI * Address feedback * Add tests * Remove unnecessary type paramerters * Fix lint issues * Re-add generics
27 lines
604 B
TypeScript
27 lines
604 B
TypeScript
import * as React from 'react';
|
|
import { Epic } from 'redux-observable';
|
|
import { renderToString, wrapRootEpic } from 'react-redux-epic';
|
|
import 'rxjs/add/operator/do';
|
|
import 'rxjs/add/operator/ignoreElements';
|
|
|
|
interface Action {
|
|
type: string;
|
|
payload: any;
|
|
}
|
|
|
|
const rootEpic: Epic<Action, {}> = action$ => {
|
|
return action$
|
|
.do(action => {
|
|
// Action dispatched
|
|
})
|
|
.ignoreElements();
|
|
};
|
|
|
|
const wrappedRootEpic = wrapRootEpic(rootEpic);
|
|
|
|
renderToString(<div>Hello, world</div>, wrappedRootEpic).subscribe({
|
|
next({ markup }) {
|
|
// Done
|
|
}
|
|
});
|