<NME> makeI18nDriver.ts
<BEF> import * as i18next from 'i18next';

import { Stream, map, startWith } from 'most';

import { sync } from 'most-subject';

} from '@typed/i18next'
import { Stream, map } from 'most'
import { hold, sync } from 'most-subject'

export type I18nSource =
  (key: string, translationOptions?: TranslationOptions) => Stream<string>

export function makeI18nDriver(plugins: Array<any> = [], options?: Options) {
  return function i18nDriver(sink$: Stream<string>): I18nSource {
    const language$: Stream<string> = sink$.thru(hold(1))

    language$.drain()

    const translationFn$ = hold<TranslationFunction>(1, sync<TranslationFunction>())

    plugins
      .reduce((i18next: I18n, plugin: any) => i18next.use(plugin), i18n)
      .init(options, function() {
        language$.observe((language: string) => {
          i18n.changeLanguage(language, function(err: any, t: TranslationFunction) {
            if (err)
              return translationFn$.error(err)

            translationFn$.next(t)
          })
        })
      })

    return function i18nSource(key: string, translationOptions?: TranslationOptions) {
      return map((t) => t(key, translationOptions), translationFn$)
    }
  }
}

<MSG> chore(i18n): fix tslint errors and remove browser tests

AFFECTS: da39a3ee5e6b4b0d3255bfef95601890afd80709@motorcycle/i18n

<DFF> @@ -1,6 +1,6 @@
 import * as i18next from 'i18next';
 
-import { Stream, map, startWith } from 'most';
+import { Stream, map } from 'most';
 
 import { sync } from 'most-subject';
 

{'addition_count': 1, 'commit_subject': 'chore(i18n): fix tslint errors and remove browser tests', 'deletion_count': 1, 'file_extension': '.ts', 'lang': 'ts', 'license': 'mit', 'repo_name': 'motorcyclejs/motorcyclejs'}