How to use the mobx-utils.now function in mobx-utils

To help you get started, we’ve selected a few mobx-utils 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 NUbots / NUsight2 / src / client / components / chart / line_chart / view_model.ts View on Github external
get now() {
    return (now('frame') / 1000) - this.model.startTime
  }
github NUbots / NUsight2 / src / client / components / script_tuner / model.ts View on Github external
get playTime() {
    const time = this.isPlaying
      ? this.currentTime + (now('frame') - this.playStartedAt)
      : this.currentTime

    return time >= this.endTime ? this.endTime : time
  }
github wasd171 / chatinder / app / stores / Clock.js View on Github external
@computed get time() {
		return mobxUtils.now(this.interval);
	}
github NUbots / NUsight2 / src / client / components / classifier / classified_image / stories / classified_image.stories.tsx View on Github external
    disposeOnUnmount(this, reaction(() => this.props.animate && now('frame'), this.update))
  }
github NUbots / NUsight2 / src / client / components / three / stories / three.stories.tsx View on Github external
    this.props.animate && disposeOnUnmount(this, reaction(() => now('frame'), this.update))
  }
github NUbots / NUsight2 / src / client / components / localisation / view.tsx View on Github external
    disposeOnUnmount(this, reaction(() => now('frame'), this.onAnimationFrame))
  }
github winterbe / RNTimerExample / src / stores / TimerModel.js View on Github external
@computed get elapsedTime() {
        if (this.isRunning) {
            return now(TICK_INTERVAL) - this.startTime;
        } else {
            return 0;
        }
    }