Skip to content

Commit

Permalink
Merge pull request #499 from kadirahq/story-order-hmr
Browse files Browse the repository at this point in the history
Keep kind order when disposing them
  • Loading branch information
Muhammed Thanish authored Sep 27, 2016
2 parents 6de3937 + 31b7f83 commit c46a341
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/preview/story_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class StoryStore {
getStoryKinds() {
return Object.keys(this._data)
.map(key => this._data[key])
.filter(kind => Object.keys(kind.stories).length > 0)
.sort((info1, info2) => (info1.index - info2.index))
.map(info => info.kind);
}
Expand Down Expand Up @@ -59,7 +60,7 @@ export default class StoryStore {
}

removeStoryKind(kind) {
delete this._data[kind];
this._data[kind].stories = {};
}

hasStoryKind(kind) {
Expand Down

0 comments on commit c46a341

Please sign in to comment.