I'm trying to cache ajax data called via an a redux-observable epic.

My goal is to call the API only the first time I dispatch `LOAD_DATA_REQUEST`, then the second time return the cached data.

Below is the code I've tried, but the data is not cached, the API is being call whenever I dispatch `LOAD_DATA_REQUEST`.

```
const loadDataEpic =
        action$ => action$.ofType(LOAD_DATA_REQUEST)
            .mergeMap(action => getData$(action.criteria)
                .map(x => loadDataSuccess(x.response))
                .catch(error => Observable.of(loadDataFailure(error.xhr)))
            );

const getData$ = criteria => Observable.ajax.post('some-url', criteria)
    .publishLast()
    .refCount();

export default combineEpics(
    loadDataEpic 
);

```

I also tried this:

```
const getData$ = criteria => Observable.ajax.post('some-url', criteria)
    .publishReplay(1)
    .refCount();

```

and

```
const getData$ = criteria => Observable.ajax.post('some-url', criteria)
    .shareReplay();

```