How to use the @rematch/core.dispatch.game function in @rematch/core

To help you get started, we’ve selected a few @rematch/core 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 EvanBacon / Expo-Nitro-Roll / Game / Game.js View on Github external
onTouchesBegan = async ({ pageX: x, pageY: y }) => {
    if (this.gameEnded) {
      this.gameEnded = false;

      dispatch.score.reset();
      dispatch.game.play();
    } else if (Math.round(randomRange(0, 3)) === 0) {
      // this.takeScreenshot();
    }
    this.moveSquare();
  };
github EvanBacon / Expo-Pillar-Valley / client / src / Game / Game.js View on Github external
gameOver = (animate = true) => {
    this.takeScreenshot();
    this.screenShotTaken = false;
    dispatch.score.reset();
    this.score = 0;
    dispatch.game.menu();

    this.cachedRotationVelocity = 0;

    if (animate) {
      this.balls[this.mainBall].hide({ onComplete: () => this.reset() });
      this.balls[1 - this.mainBall].hide({ duration: 0.4 });

      for (const target of this.targets) {
        target.animateOut();
      }
    } else {
      this.reset();
    }
  };
github EvanBacon / Expo-Nitro-Roll / Game / Game.js View on Github external
async reset() {
    super.reset();
    dispatch.game.menu();
    AudioManager.sharedInstance.playAsync('song', true, false);
    await this.loadGame();
  }
github EvanBacon / Expo-Pillar-Valley / client / src / components / Button / Home.js View on Github external
onPress = () => {
    dispatch.game.menu();
    if (this.props.onPress) this.props.onPress();
  };
  render() {