Ejemplo n.º 1
0
  constructor() {
    this.bindActions(ProfileActions);
    this.errorMessage = null;

    this.state = {
      profile: null
    };
  }

  // onGetProfile() {
  //   this.setState({
  //     profile: null
  //   });
  // }

  onUpdateProfile(profile) {
    this.setState({
      profile: profile
    });
  }

  onProfileFailed(errorMessage) {
    this.setState({
      profile: null,
      errorMessage: errorMessage
    });
  }
}

export default alt.createStore(ProfileStore, 'ProfileStore');
import PersonalTourActions from 'PersonalTourActions';

class PersonalTourStore {
  constructor() {
    this.bindActions(PersonalTourActions);
    this.errorMessage = null;
    this.state = {
      tours: []
    };
  }

  onUpdateTours(tour) {
    this.setState({ tours: this.state.tours.concat(tour) });
  }

  onFetchTours() {
    this.state.tours = [];
  }

  onReloadTours() {
    this.state.tours = [];
  }

  onToursFailed(errorMessage) {
    this.errorMessage = errorMessage;
  }

}

export default alt.createStore(PersonalTourStore, 'PersonalTourStore');
Ejemplo n.º 3
0
    const uid = this.getState().user.id;
    return (uid !== null);
  }

  getUser() {
    return this.getState().user;
  }

  getUid() {
    const st = this.getState().user;
    return st.id_token;
  }

  getId() {
    const st = this.getState().user;
    return st.id;
  }

  getName() {
    const st = this.getState().user;
    return st.name;
  }

  getEmail() {
    const st = this.getState().user;
    return st.email;
  }
}

export default alt.createStore(AuthStore, 'AuthStore');