<commit_before>import { OpaqueToken, Provider } from '@angular/core';

import { flatten } from './util';
import { CONNECT_EFFECTS_PROVIDER, BOOTSTRAP_EFFECTS } from './effects';
import { STATE_UPDATES_PROVIDER } from './state-updates';


export function runEffects(...effects: any[]) {
  const allEffects = flatten(effects)
    .map(effect => new Provider(BOOTSTRAP_EFFECTS, {
      useClass: effect,
      multi: true
    }));

  return [
    ...allEffects,
    CONNECT_EFFECTS_PROVIDER,
    STATE_UPDATES_PROVIDER
  ];<commit_msg>feat(DI): register individual effect instances with the DI (#13)<commit_after>import { OpaqueToken, Provider } from '@angular/core';

import { flatten } from './util';
import { CONNECT_EFFECTS_PROVIDER, BOOTSTRAP_EFFECTS } from './effects';
import { STATE_UPDATES_PROVIDER } from './state-updates';


export function runEffects(...effects: any[]) {
  const individuals = flatten(effects);

  const allEffects = individuals
    .map(effectClass => new Provider(BOOTSTRAP_EFFECTS, {
      useExisting: effectClass,
      multi: true
    }));

  return [
    ...individuals,
    ...allEffects,
    CONNECT_EFFECTS_PROVIDER,
    STATE_UPDATES_PROVIDER
  ];
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.0016891891891891893, 'mean_word_length': 3.9789915966386555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7615273', 'n_tokens_mistral': 409, 'n_tokens_neox': 391, 'n_words': 84}