How to use the @rematch/core.dispatch.dailyStreak 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-Pillar-Valley / client / src / rematch / models.js View on Github external
compareDaily: async (props, { user }) => {
      const dailyVisits = await incrementDailyReward();

      if (dailyVisits !== user.dailyVisits) {
        // console.log('Yay! You came back, your streak is now at: ' + dailyVisits);

        dispatch.dailyStreak.set(dailyVisits);
        if (dailyVisits > user.dailyVisits) {
          dispatch.dailyStreak.rewardUser(dailyVisits);
        }
        dispatch.user.update({ dailyVisits });
        // / Give reward!
      } else {
        // console.log('ummmm', dailyVisits);
      }
    },
  },
github EvanBacon / Expo-Crossy-Road / ExpoParty / Fire.js View on Github external
compareDaily = async () => {
    const dailyVisits = await this.incrementDailyReward();

    if (dailyVisits != this.userData.dailyVisits) {
      // console.log('Yay! You came back, your streak is now at: ' + dailyVisits);

      dispatch.dailyStreak.assign(dailyVisits);
      if (dailyVisits > this.userData.dailyVisits) {
        dispatch.dailyStreak.rewardUser(dailyVisits);
      }
      this.userData.dailyVisits = dailyVisits;
      /// Give reward!
    } else {
      // console.log('ummmm', dailyVisits);
    }
  };
github EvanBacon / Expo-Nitro-Roll / ExpoParty / Fire.js View on Github external
compareDaily = async () => {
    const dailyVisits = await this.incrementDailyReward();

    if (dailyVisits != this.userData.dailyVisits) {
      // console.log('Yay! You came back, your streak is now at: ' + dailyVisits);

      dispatch.dailyStreak.assign(dailyVisits);
      if (dailyVisits > this.userData.dailyVisits) {
        dispatch.dailyStreak.rewardUser(dailyVisits);
      }
      this.userData.dailyVisits = dailyVisits;
      /// Give reward!
    } else {
      // console.log('ummmm', dailyVisits);
    }
  };
github EvanBacon / Expo-Pillar-Valley / client / src / rematch / models.js View on Github external
compareDaily: async (props, { user }) => {
      const dailyVisits = await incrementDailyReward();

      if (dailyVisits !== user.dailyVisits) {
        // console.log('Yay! You came back, your streak is now at: ' + dailyVisits);

        dispatch.dailyStreak.set(dailyVisits);
        if (dailyVisits > user.dailyVisits) {
          dispatch.dailyStreak.rewardUser(dailyVisits);
        }
        dispatch.user.update({ dailyVisits });
        // / Give reward!
      } else {
        // console.log('ummmm', dailyVisits);
      }
    },
  },
github EvanBacon / Expo-Crossy-Road / ExpoParty / Fire.js View on Github external
compareDaily = async () => {
    const dailyVisits = await this.incrementDailyReward();

    if (dailyVisits != this.userData.dailyVisits) {
      // console.log('Yay! You came back, your streak is now at: ' + dailyVisits);

      dispatch.dailyStreak.assign(dailyVisits);
      if (dailyVisits > this.userData.dailyVisits) {
        dispatch.dailyStreak.rewardUser(dailyVisits);
      }
      this.userData.dailyVisits = dailyVisits;
      /// Give reward!
    } else {
      // console.log('ummmm', dailyVisits);
    }
  };
github EvanBacon / Expo-Nitro-Roll / ExpoParty / Fire.js View on Github external
compareDaily = async () => {
    const dailyVisits = await this.incrementDailyReward();

    if (dailyVisits != this.userData.dailyVisits) {
      // console.log('Yay! You came back, your streak is now at: ' + dailyVisits);

      dispatch.dailyStreak.assign(dailyVisits);
      if (dailyVisits > this.userData.dailyVisits) {
        dispatch.dailyStreak.rewardUser(dailyVisits);
      }
      this.userData.dailyVisits = dailyVisits;
      /// Give reward!
    } else {
      // console.log('ummmm', dailyVisits);
    }
  };
github EvanBacon / Expo-Pillar-Valley / client / src / rematch / models.js View on Github external
...nextFirebaseAuthData,
      };

      const updates = {};
      for (const key of Object.keys(combinedUserData)) {
        if (
          combinedUserData[key] != undefined &&
          combinedUserData[key] !== nextLocalUserData[key]
        ) {
          updates[key] = combinedUserData[key];
        }
      }
      if (Object.keys(updates).length > 0) {
        dispatch.user.update(updates);
      }
      dispatch.dailyStreak.compareDaily();
      dispatch.players.update({
        uid: combinedUserData.uid,
        user: combinedUserData,
      });

      if (Settings.isCacheProfileUpdateActive) {
        const shouldUpdateKey = '@PillarValley/shouldUpdateProfile';
        const something = await getItemWithExpiration(shouldUpdateKey);
        if (!something) {
          const some = await setItemWithExpiration(
            shouldUpdateKey,
            { update: true },
            Settings.shouldDelayFirebaseProfileSyncInMinutes,
          );
          dispatch.user.syncLocalToFirebase();
        } else {