How to use the @aragon/api.events.SYNC_STATUS_SYNCING function in @aragon/api

To help you get started, we’ve selected a few @aragon/api 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 1Hive / time-lock-app / app / src / script.js View on Github external
(state, { event, returnValues, blockNumber }) => {
      // dont want to listen for past events for now
      // (our app state can be obtained from smart contract vars)
      if (blockNumber && blockNumber <= currentBlock) return state

      let nextState = {
        ...state,
      }

      switch (event) {
        case events.ACCOUNTS_TRIGGER:
          return updateConnectedAccount(nextState, returnValues)
        case events.SYNC_STATUS_SYNCING:
          return { ...nextState, isSyncing: true }
        case events.SYNC_STATUS_SYNCED:
          return { ...nextState, isSyncing: false }
        case 'ChangeLockDuration':
          return updateLockDuration(nextState, returnValues)
        case 'ChangeLockAmount':
          return updateLockAmount(nextState, returnValues)
        case 'ChangeSpamPenaltyFactor':
          return updateSpamPenaltyFactor(nextState, returnValues)
        case 'NewLock':
          return newLock(nextState, returnValues)
        case 'Withdrawal':
          return newWithdrawal(nextState, returnValues)
        default:
          return state
      }
github 1Hive / conviction-voting-app / app / src / script.js View on Github external
break
      }
      case 'ProposalExecuted': {
        const { id } = returnValues
        nextState = {
          ...nextState,
          proposals: nextState.proposals.map(proposal => {
            if (proposal.id === parseInt(id)) {
              return { ...proposal, executed: true }
            }
            return proposal
          }),
        }
        break
      }
      case events.SYNC_STATUS_SYNCING:
        nextState = { ...nextState, isSyncing: true }
        break
      case events.SYNC_STATUS_SYNCED:
        nextState = { ...nextState, isSyncing: false }
        break
    }

    console.log(nextState)
    return nextState
  }
github 1Hive / token-request-app / app / src / script.js View on Github external
(state, { event, returnValues, blockNumber }) => {
      let nextState = {
        ...state,
      }

      switch (event) {
        case events.ACCOUNTS_TRIGGER:
          return updateConnectedAccount(nextState, returnValues)
        case events.SYNC_STATUS_SYNCING:
          return { ...nextState, isSyncing: true }
        case events.SYNC_STATUS_SYNCED:
          return { ...nextState, isSyncing: false }
        case 'TokenRequestCreated':
          return newTokenRequest(nextState, returnValues, settings, blockNumber)
        case 'TokenRequestRefunded':
          return requestRefunded(nextState, returnValues)
        case 'TokenRequestFinalised':
          return requestFinalised(nextState, returnValues)
        default:
          return state
      }
    },
    {