How to use react-native-router-flux - 10 common examples

To help you get started, we’ve selected a few react-native-router-flux 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 crownstone / CrownstoneApp / js / views / settingsViews / SettingsSphere.tsx View on Github external
.then(() => {
                this.props.eventBus.emit('hideLoading');
                this.deleting = true;
                Actions.pop();

                let state = this.props.store.getState();
                let actions = [];
                if (state.app.activeSphere === this.props.sphereId)
                  actions.push({type:"CLEAR_ACTIVE_SPHERE"});

                actions.push({type:'REMOVE_SPHERE', sphereId: this.props.sphereId});

                // stop tracking sphere.
                Bluenet.stopTrackingIBeacon(state.spheres[this.props.sphereId].config.iBeaconUUID);
                this.props.store.batchDispatch(actions);
              })
          }
github steelx / react-native-redux-app / src / store / reducers / routes.reducer.js View on Github external
export default function routesReducer(state = initialState, action = {}) {
    switch (action.type) {
        // focus action is dispatched when a new screen comes into focus
        case ActionConst.FOCUS:
            console.log(action);
            return {
                ...state,
                scene: action.scene,
            };

        // ...other actions

        default:
            return state;
    }
}
github EdgeApp / edge-react-gui / src / actions / SendConfirmationActions.js View on Github external
edgeSignedTransaction.metadata = edgeMetadata
    edgeSignedTransaction.wallet = wallet

    playSendSound().catch(error => console.log(error)) // Fail quietly
    Alert.alert(s.strings.transaction_success, s.strings.transaction_success_message, [
      {
        onPress () {},
        style: 'default',
        text: s.strings.string_ok
      }
    ])

    if (guiMakeSpendInfo.onDone) {
      guiMakeSpendInfo.onDone(null, edgeSignedTransaction)
    } else {
      Actions.replace(TRANSACTION_DETAILS, { edgeTransaction: edgeSignedTransaction })
    }
  } catch (e) {
    console.log(e)
    dispatch(updateSpendPending(false))
    let message = sprintf(s.strings.transaction_failure_message, e.message)
    if (e.name === 'ErrorEosInsufficientCpu') {
      message = s.strings.send_confirmation_eos_error_cpu
    } else if (e.name === 'ErrorEosInsufficientNet') {
      message = s.strings.send_confirmation_eos_error_net
    } else if (e.name === 'ErrorEosInsufficientRam') {
      message = s.strings.send_confirmation_eos_error_ram
    }

    dispatch(updateTransaction(edgeSignedTransaction, null, true, new Error('broadcastError')))
    Alert.alert(s.strings.transaction_failure, message, [
      {
github CodeRabbitYu / react-native-template / app / Router.js View on Github external
const reducerCreate = params => {
    const defaultReducer = new Reducer(params);
    return (state, action) => {
        // console.log('ACTION:',action,Actions.currentScene)
        // console.log('Actions:', Actions);
        return defaultReducer(state, action);
    };
};
github mongrov / roverz / src / auth / Login / LoginView.js View on Github external
this._service.onLogin((/* err, */ /* res */) => {
      // console.log('onLogink', err, res, this._service.service.loggedInUser);
      if (this._mounted && this._service.service.loggedInUser) {
        if (this._service.service.loggedInUser.username) {
          Actions.app({ type: 'reset' });
        }
      }
    });
    this._mounted = true;
github mongrov / roverz / src / auth / Login / Register.js View on Github external
}, () => {
          // console.log('RegCB 01', lerr, lres);
          if (this._net.service.loggedInUser && this._net.service.loggedInUser.username) {
            Actions.app({ type: 'reset' });
          } else {
            this.setState({ setUsername: true, alert: { success: '' } });
            this._net.service.getUsernameSuggestion((Uerr, Ures) => {
              if (Uerr) {
                this.setState({ alert: { error: 'Error fetching username!' } });
              } else if (Ures) {
                this.setState({ inputUsername: Ures });
              }
            });
          }
        });
      });
github 7kfpun / FinanceReactNative / app / views / settings / index.js View on Github external
onActionSelected(position) {
    if (position === 0) {  // index of 'Add'
      Actions.add();
    } else if (position === 1) {  // index of 'Done'
      Actions.pop();
    }
  }
github rastapasta / foodsharing / src / sagas / basket.tsx View on Github external
function* deleteBasketWatcher() {
  while (true) {
    // Wait until we get a delete request
    const { payload: id } = yield take([BASKET_DELETE_REQUEST])
    try {
      // Fetch and return it
      yield deleteBasket(id)
      yield put({type: BASKET_DELETE_SUCCESS, payload: id})

      // And leave the scene of action
      Actions.pop()
    } catch(e) {/* Errors are handled via Redux reducers */}
  }
}
github realm / my-first-realm-app / react-native / QueryBasedSync / ToDo / src / components / ProjectList.js View on Github external
componentDidMount() {
    const { realm } = this.props;

    // Register an action to create a project
    Actions.refresh({
      rightTitle: " Create",
      onRight: () => {
        this.toggleModal();
      }
    });

    // Get a result containing all projects
    const projects = realm
      .objects("Project")
      .filtered("owner == $0", this.props.user.identity)
      .sorted("timestamp", true);

    // When the list of projects change, React won't know about it because the Result object itself did not change.
    projects.addListener(() => {
      // Bump a data version counter that we'll pass to components that should update when the projects change.
      this.setState({ dataVersion: this.state.dataVersion + 1 });
github J-Priebe / react-native-facebook-firebase / src / components / Splash.js View on Github external
checkFirebaseAuth(accessTokenData).then((user) => {
          
          if (user){
            Actions.home({type: ActionConst.RESET})

          }else{ // user needs to login to get a Facebook auth token
            Actions.login({type: ActionConst.RESET})
          }
        })
      })