How to use the rx.Observable.combineLatest function in rx

To help you get started, we’ve selected a few rx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pusher-community / cyclejs-realtime-chat / src / app.js View on Github external
const model = actions => {
    const message$ = Rx.Observable.merge(
      actions.changeMessage$,
      // we listen to this observable
      // because when the submit button is clicked
      // we want to clear the message input out
      actions.submitMessage$.map(x => '')
    ).startWith('')

    return Observable.combineLatest(
      allPusherMessages$,
      actions.submitUsername$.startWith(''),
      message$,
      (pusherMessages, username, message) => ({ pusherMessages, username, message })
    );
  };
github laszlokorte / tams-tools / app / components / kv / panels / open / view.js View on Github external
export default (state$, logicField$) =>
  O.combineLatest(state$, logicField$, render)
;
github tusharmath / Multi-threaded-downloader / src / Utils.js View on Github external
export const WriteBuffer = ({FILE, fd$, buffer$}) => {
  const Write = R.compose(FILE.write, CreateWriteBufferParams)
  return O.combineLatest(fd$, buffer$).flatMap(params => {
    return Write(params).map(R.concat(R.nth(1, params)))
  })
}
/**
github ivan-kleshnin / cyclejs-examples / rx.utils.js View on Github external
let deriveN = curry((deriveFn, os) => {
  return $.combineLatest(...os, deriveFn).distinctUntilChanged().shareReplay(1)
})
github jlesquembre / autopilot / electron_ui / src / components / input.js View on Github external
function view(state$, isFocus$, id, labelName){

    const vtree$ = Observable.combineLatest(state$, isFocus$,

            ( value, focus ) =>

            div({className: styles.group},
                [
                    input({id, required: true, className: styles.input, value}),
                    span({className: styles.bar}),
                    label({for: id, className: ( focus || value ? styles.labelActive : styles.labelInactive)}, labelName),
                ])
            );

    return vtree$;
}
github byteclubfr / copycast / client / components / App.js View on Github external
const model = (actions$) => {
	return Observable.combineLatest(actions$)
		.map(([ tree, sel, ...x ]) => [ last(tree), sel, getContents(tree, sel), ...x ])
}
github d6u / web-playground / src / command / start / helper.js View on Github external
export const processAssetFiles = curry(function (opts, serveAssets, config) {
  return Observable.combineLatest(
    processJsFile(opts, serveAssets, config),
    processCssFile(opts, serveAssets, config),
    processHtmlFile(opts, serveAssets, config)
  );
});
github ivan-kleshnin / cyclejs-examples / 2.3-routing / src / pages.js View on Github external
let User = function ({state, params}) {
  return {
    DOM: Observable.combineLatest(
      Menu(state), params,
        (menu, params) => {
        return div([
          h1("User #" + params.id),
          menu,
          p(["[user"  + params.id + " content]"])
        ])
      })
  }
}
github nicoespeon / trello-kanban-analysis-tool / app / components / TrelloCFD / TrelloCFD.js View on Github external
{ className: R.join(' ', R.concat(['button'], props.classNames)) },
    props.label)
  );

  const parsedActions$ = Observable.combineLatest(
    dates$,
    lists$,
    actions$,
    currentDate$,
    ({ startDate, endDate }, lists, actions, currentDate) => R.compose(
      filterBetweenDates(startDate, nextDay(endDate)),
      parseActions(currentDate, lists)
    )(actions)
  );

  const graph$ = Observable.combineLatest(
    displayedLists$,
    parsedActions$,
    parseToGraph
  );

  return {
    DOM: vtree$,
    Trello: clicks$,
    Graph: graph$,
    CSV: graph$.map(graphToCSV),
  };
}