Sawtaytoes
1/12/2019 - 10:53 AM

Transducer ForkJoin Combination

createExecutableObservable(
  of(
    itemsByLine
    .split('\n')
  )
  .pipe(
    switchMap(itemList => (
      forkJoin(
        (
          from(itemList)
          .pipe(
            filter(Boolean),
            filter(item => (
              !(
                whitelist
                .includes(item)
              )
            )),
            map(item => (
              `*${item}*`
            )),
            toArray(),
          )
        ),
        (
          from(itemList)
          .pipe(
            filter(Boolean),
            filter(item => (
              !(
                whitelist
                .includes(item)
              )
            )),
            map(item => (
              `*.${item}.*`
            )),
            toArray(),
          )
        ),
      )
    )),
    map(([
      itemListAsterisk,
      itemListAsteriskWithDot,
    ]) => (
      itemListAsterisk
      .concat(itemListAsteriskWithDot)
    )),
  )
)
.execute()