Merge pull request #499 from kadirahq/story-order-hmr

Keep kind order when disposing them
This commit is contained in:
Muhammed Thanish 2016-09-27 18:11:44 +05:30 committed by GitHub
commit c46a341556

View File

@ -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);
}
@ -59,7 +60,7 @@ export default class StoryStore {
}
removeStoryKind(kind) {
delete this._data[kind];
this._data[kind].stories = {};
}
hasStoryKind(kind) {