Move getInitialState() to be the first function after a store's constructor

This commit is contained in:
Brett Sun 2016-01-13 17:13:44 +01:00
parent a6463087c0
commit 466872affb
1 changed files with 13 additions and 13 deletions

View File

@ -14,6 +14,18 @@ class PrizeRatingStore {
});
}
getInitialState() {
this.ratings = [];
this.currentRating = null;
this.average = null;
return {
ratings: this.ratings,
currentRating: this.currentRating,
average: this.average
};
}
onUpdatePrizeRatings(ratings) {
this.ratings = ratings;
}
@ -30,18 +42,6 @@ class PrizeRatingStore {
onResetPrizeRatings() {
this.getInitialState();
}
getInitialState() {
this.ratings = [];
this.currentRating = null;
this.average = null;
return {
ratings: this.ratings,
currentRating: this.currentRating,
average: this.average
};
}
}
export default alt.createStore(PrizeRatingStore, 'PrizeRatingStore');
export default alt.createStore(PrizeRatingStore, 'PrizeRatingStore');