<commit_before>import { createEpicMiddleware, Epic, combineEpics,
  EpicMiddleware, ActionsObservable } from '../index';
import { Action } from 'redux';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/mapTo';

const epic1: Epic = (action$, store) =>
  action$.ofType('FIRST')
    .mapTo({
      type: 'first',
      payload: store.getState()
    });

const epic2: Epic = (action$, store) =>
  action$.ofType('SECOND')
    .mapTo({
      type: 'second',
      payload: store.getState()
    });

const epic3: Epic = action$ =>
  action$.ofType('THIRD')
    .mapTo({
      type: 'third'
    });

const epic4: Epic = () =>
  Observable.of({
    type: 'third'
  });

const rootEpic1: Epic = combineEpics(epic1, epic2, epic3, epic4);
const rootEpic2: Epic = combineEpics(epic1, epic2, epic3, epic4);

const epicMiddleware: EpicMiddleware = createEpicMiddleware(rootEpic1);

epicMiddleware.replaceEpic(rootEpic2);

// should be a constructor that returns an observable
const actionsSubject = Observable.create(() => {});
const aoTest: Observable<Action> = new ActionsObservable(actionsSubject);<commit_msg>chore(testing): add more complete testing for TypeScript<commit_after>import { createEpicMiddleware, Epic, combineEpics,
  EpicMiddleware, ActionsObservable } from '../index';
import { Action, createStore, applyMiddleware } from 'redux';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/mapTo';
import 'rxjs/add/operator/mergeMap';

const epic1: Epic = (action$, store) =>
  action$.ofType('FIRST')
    .mapTo({
      type: 'first',
      payload: store.getState()
    });

const epic2: Epic = (action$, store) =>
  action$.ofType('SECOND')
    .mapTo('second')
    .mergeMap(type => Observable.of({ type }));

const epic3: Epic = action$ =>
  action$.ofType('THIRD')
    .mapTo({
      type: 'third'
    });

const epic4: Epic = () =>
  Observable.of({
    type: 'fourth'
  });

const rootEpic1: Epic = combineEpics(epic1, epic2, epic3, epic4);
const rootEpic2: Epic = combineEpics(epic1, epic2, epic3, epic4);

const epicMiddleware: EpicMiddleware = createEpicMiddleware(rootEpic1);

epicMiddleware.replaceEpic(rootEpic2);

// should be a constructor that returns an observable
const actionsSubject = Observable.create(() => {});
const aoTest: Observable<Action> = new ActionsObservable(actionsSubject);

const reducer = (state = [], action) => state.concat(action);
const store = createStore(
  reducer,
  applyMiddleware(epicMiddleware)
);

store.dispatch({ type: 'FIRST' });
store.dispatch({ type: 'SECOND' });
{'fraction_non_alphanumeric': 0.15188427864484202, 'fraction_numerical': 0.01218119527978683, 'mean_word_length': 4.567796610169491, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '59045', 'n_tokens_mistral': 872, 'n_tokens_neox': 858, 'n_words': 206}