<commit_before>import { A, O, run } from './boa';
import { init as dom } from 'boa-handler-dom';
import { app } from './app';
import { view } from './views/app';

const main = (): void => {
  run((action$: O<A<any>>, options?: any): O<A<any>> => {
    return O.merge(
      app(action$),
      dom({
        root: 'div#app',
        render: view,
        renderActionType: 'render'
      }).handler(action$, options)
    );
  });
};<commit_msg>add history handler<commit_after>import { A, O, run } from './boa';
import { init as dom } from 'boa-handler-dom';
import { init as history } from 'boa-handler-history';
import { app } from './app';
import { view } from './views/app';

const main = (): void => {
  run((action$: O<A<any>>, options?: any): O<A<any>> => {
    return O.merge(
      app(action$),
      dom({
        root: 'div#app',
        render: view,
        renderActionType: 'render'
      }).handler(action$, options),
      history({
        goToActionType: 'go-to',
        historyType: 'hash', // use hashchanged
        routes: [
          { name: 'news', path: '/news/:page' },
          { name: 'user', path: '/user/:id' },
          { name: 'item', path: '/item/:id' }
        ],
        routeActionType: 'path-changed'
      }).handler(action$, options)
    );
  });
};
{'fraction_non_alphanumeric': 0.20108275328692962, 'fraction_numerical': 0.0, 'mean_word_length': 2.3785900783289815, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '4758352', 'n_tokens_mistral': 423, 'n_tokens_neox': 426, 'n_words': 112}