mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 02:31:49 +08:00
render sync if possible
This commit is contained in:
parent
ab6ef53330
commit
d1c6696eff
@ -145,9 +145,19 @@ export default class StoryStore extends EventEmitter {
|
|||||||
data === undefined ? this._selection : { storyId: data.storyId, viewMode: data.viewMode };
|
data === undefined ? this._selection : { storyId: data.storyId, viewMode: data.viewMode };
|
||||||
this._error = error === undefined ? this._error : error;
|
this._error = error === undefined ? this._error : error;
|
||||||
|
|
||||||
|
let failed = false;
|
||||||
|
try {
|
||||||
|
if (this._channel) {
|
||||||
|
this._channel.emit(Events.STORY_RENDER);
|
||||||
|
}
|
||||||
|
failed = true;
|
||||||
|
} catch (e) {
|
||||||
|
failed = true;
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// preferred method to emit event.
|
// preferred method to emit event.
|
||||||
if (this._channel) {
|
if (this._channel && failed) {
|
||||||
this._channel.emit(Events.STORY_RENDER);
|
this._channel.emit(Events.STORY_RENDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user