mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Merge pull request #499 from kadirahq/story-order-hmr
Keep kind order when disposing them
This commit is contained in:
commit
c46a341556
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user