<commit_before>import { Injectable, OnDestroy } from '@angular/core';

import { Effect, Actions } from '@ngrx/effects';

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/mapTo';

import { NgrxJsonApiActions } from './actions';
import { NgrxJsonApi } from './api';
import { Payload } from './interfaces';
import { toPayload } from './utils';

@Injectable()
export class JsonApiEffects implements OnDestroy {
  constructor(
    private actions$: Actions,
    private jsonApi: NgrxJsonApi
  ) { }

  @Effect() createResource$ = this.actions$
    .ofType(NgrxJsonApiActions.API_CREATE_INIT)
    .map<Payload>(toPayload)
    .mergeMap((payload: Payload) => {
      return this.jsonApi.create({type: payload.data})
        .mapTo(NgrxJsonApiActions.apiCreateSuccess(payload))
        .catch(() => Observable.of(
          NgrxJsonApiActions.apiCreateFail(payload)
        ))
    });
<commit_msg>Refactor: Make class names consistents<commit_after>import { Injectable, OnDestroy } from '@angular/core';

import { Effect, Actions } from '@ngrx/effects';

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/mapTo';

import { NgrxJsonApiActions } from './actions';
import { NgrxJsonApi } from './api';
import { Payload } from './interfaces';
import { toPayload } from './utils';

@Injectable()
export class NgrxJsonApiEffects implements OnDestroy {
  constructor(
    private actions$: Actions,
    private jsonApi: NgrxJsonApi
  ) { }

  @Effect() createResource$ = this.actions$
    .ofType(NgrxJsonApiActions.API_CREATE_INIT)
    .map<Payload>(toPayload)
    .mergeMap((payload: Payload) => {
      return this.jsonApi.create({type: payload.data})
        .mapTo(NgrxJsonApiActions.apiCreateSuccess(payload))
        .catch(() => Observable.of(
          NgrxJsonApiActions.apiCreateFail(payload)
        ))
    });

{'fraction_non_alphanumeric': 0.13925278990781173, 'fraction_numerical': 0.0, 'mean_word_length': 4.091358024691358, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2524160', 'n_tokens_mistral': 653, 'n_tokens_neox': 648, 'n_words': 134}