Sawtaytoes
1/12/2019 - 10:41 AM

Transducer Dual Observable

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