react-redux-isomorphic
Version:
Set of utilities for creating isomorphic applications using react-redux
15 lines (14 loc) • 401 B
JavaScript
import { isAllComponentsLoaded } from './isAllComponentsLoaded';
export var waitForContext = function waitForContext(store) {
if (isAllComponentsLoaded(store)) {
return Promise.resolve();
}
return new Promise(function (resolve) {
var unsubscribe = store.subscribe(function () {
if (isAllComponentsLoaded(store)) {
unsubscribe();
resolve();
}
});
});
};