How to use the most.of function in most

To help you get started, we’ve selected a few most 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 motorcyclejs / core / test / index.ts View on Github external
it('only subscribes to sinks with matching drivers', () => {
        let testSubscribed: boolean = false;
        let otherSubscribed: boolean = false;

        const test = most.of(1).tap(() => {
          testSubscribed = true;
        });

        const other = most.of(2).tap(() => {
          otherSubscribed = true;
        });

        function main () {
          return {
            test,
            other,
          };
        }

        const drivers = {
          test: () => { return {}; },
        };

        Motorcycle.run<{ test: any }, any>(main, drivers);
github motorcyclejs / core / test / index.ts View on Github external
it('returns an object with property `sinks` with named keys given by main return', () => {
        const test = most.of(1);

        function main () {
          return {
            test,
          };
        }

        const drivers = {};

        const { sinks } = Motorcycle.run(main, drivers);

        assert.ok(sinks.hasOwnProperty('test'));
        assert.strictEqual((sinks.test.source as any).source, test.source);
      });
github goodmind / cycle-telegram / test / integration / index / most.ts View on Github external
let main = () => ({
    bot: most.from([
      most.of(sendLocation(
        { chat_id: GROUP_ID, latitude: 55.751244, longitude: 37.618423 },
        {}))
    ])
  })
  let { sources, run } = Cycle(main, { bot: basicDriver })
github goodmind / cycle-telegram / test / integration / index / most.ts View on Github external
let main = () => ({
    bot: most.from([
      most.of(getChatMembersCount({ chat_id: GROUP_ID }, {}))
    ])
  })
  let { sources, run } = Cycle(main, { bot: basicDriver })
github goodmind / cycle-telegram / test / integration / index / most.ts View on Github external
let main = () => ({
    bot: most.from([
      most.of(sendContact(
        { chat_id: GROUP_ID, phone_number: '+42470', first_name: 'Telegram' },
        {}))
    ])
  })
  let { sources, run } = Cycle(main, { bot: basicDriver })
github goodmind / cycle-telegram / test / integration / index / most.ts View on Github external
let main = () => ({
    bot: most.from([
      most.of(getChatAdministrators({ chat_id: GROUP_ID }, {}))
    ])
  })
  let { sources, run } = Cycle(main, { bot: basicDriver })
github reactive-react / xreact / examples / quarantine.d / type-n-search-with-undo / src / app.jsx View on Github external
.flatMapError(error=>{
                             console.log('[ERROR]:', error);
                             return most.of({message:error.error,className:'display'})
                                        .merge(most.of({className:'hidden'}).delay(3000))
                                        .map(error=>state=>({error}))
                           })
github reactive-react / xreact / examples / type-n-search / app.jsx View on Github external
.flatMapError(error=>{
                             console.log('[CRITICAL ERROR]:', error);
                             return most.of({message:error.error,className:'display'})
                                        .merge(most.of({className:'hidden'}).delay(3000))
                                        .map(error=>state=>({error}))
                           })
github nodefluent / kafka-streams / lib / dsl / KTable.js View on Github external
consumeUntilMs(ms = 1000, finishedCallback = null) {

        super.multicast();
        this.stream$ = this.stream$.until(most.of().delay(ms));

        if (!this.finalised) {
            this.finalise(finishedCallback);
        }

        return this;
    }
github beyond-labs / react-mirror / src / utils / streams / combineValuesIntoEnum.js View on Github external
streams.map($stream => {
      const $start = most.of(SKIP_TOKEN).until($stream)
      return $start.concat($stream)
    })
  )