mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
Move getInitialState() to be the first function after a store's constructor
This commit is contained in:
parent
a6463087c0
commit
466872affb
@ -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');
|
Loading…
Reference in New Issue
Block a user