brew-js-react 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! brew-js-react v0.7.0 | (c) misonou | https://misonou.github.io */
1
+ /*! brew-js-react v0.7.1 | (c) misonou | https://misonou.github.io */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory(require("zeta-dom"), require("brew-js"), require("react"), require("react-dom"), require("zeta-dom-react"), require("waterpipe"), require("jquery"));
@@ -687,13 +687,15 @@ definePrototype(ErrorBoundary, Component, {
687
687
  var context = self.props.context;
688
688
  if (!context.container) {
689
689
  setImmediate(function () {
690
- extend(self, createAsyncScope(context.container));
691
- zeta_dom_dom.on(context.container, 'error', function (e) {
692
- return emitter.emit(e, context, {
693
- error: e.error
694
- }, false);
695
- });
696
- self.forceUpdate();
690
+ if (!self.errorHandler) {
691
+ extend(self, createAsyncScope(context.container));
692
+ zeta_dom_dom.on(context.container, 'error', function (e) {
693
+ return emitter.emit(e, context, {
694
+ error: e.error
695
+ }, false);
696
+ });
697
+ self.forceUpdate();
698
+ }
697
699
  });
698
700
  return null;
699
701
  }
@@ -910,7 +912,7 @@ function createViewComponent(factory) {
910
912
  }
911
913
  return function fn(props) {
912
914
  var children = promise || factory(props.viewProps);
913
- if (isThenable(children)) {
915
+ if (promise || isThenable(children)) {
914
916
  promise = children;
915
917
  catchAsync(promise);
916
918
  } else {
@@ -918,8 +920,8 @@ function createViewComponent(factory) {
918
920
  return children;
919
921
  }
920
922
  var component = useAsync(function () {
921
- return promise.then(null, function (error) {
922
- promise = null;
923
+ promise = true;
924
+ return (isThenable(children) || factory()).then(null, function (error) {
923
925
  props.onError(error);
924
926
  });
925
927
  })[0];