brew-js-react 0.7.2 → 0.7.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brew-js-react",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/view.d.ts CHANGED
@@ -249,14 +249,14 @@ export function matchView(path: string, ...views: ViewComponent<any>[]): ViewCom
249
249
  * Renders view by matching current route state against registered route parameters of each supplied views.
250
250
  * @param args A list of view components created by {@link registerView}.
251
251
  */
252
- export function renderView(...args: ViewComponent<any>[]): JSX.Element;
252
+ export function renderView(...args: ViewComponent<any>[]): React.ReactElement;
253
253
 
254
254
  /**
255
255
  * Renders view by matching current route state against registered route parameters of each supplied views.
256
256
  * @param props Optional parameters passed to the root element rendered by the function.
257
257
  * @param args A list of view components created by {@link registerView}.
258
258
  */
259
- export function renderView(props: ViewComponentRootProps, ...args: ViewComponent<any>[]): JSX.Element;
259
+ export function renderView(props: ViewComponentRootProps, ...args: ViewComponent<any>[]): React.ReactElement;
260
260
 
261
261
  /**
262
262
  * Resets all rendered views by unmounting and remounting the view components, or re-rendering the view components if they are currently replaced by error views.
package/view.js CHANGED
@@ -31,8 +31,7 @@ onAppInit(function () {
31
31
  (function updateViewRecursive(next) {
32
32
  each(next.children, function (i, v) {
33
33
  e.waitFor(new Promise(function (resolve) {
34
- v.onRender = resolve;
35
- v.forceUpdate();
34
+ v.forceUpdate(resolve);
36
35
  }).then(function () {
37
36
  updateViewRecursive(v);
38
37
  }));
@@ -186,7 +185,6 @@ definePrototype(ViewContainer, Component, {
186
185
  if (self.context.active) {
187
186
  self.updateView();
188
187
  }
189
- self.onRender();
190
188
  return self.views;
191
189
  },
192
190
  updateView: function () {
@@ -234,10 +232,12 @@ definePrototype(ViewContainer, Component, {
234
232
  app.emit('pageleave', element, { pathname: context.page.path, view: V }, true);
235
233
  return animateOut(element, 'show').then(function () {
236
234
  self.views[0] = null;
237
- self.forceUpdate();
235
+ return new Promise(function (resolve) {
236
+ self.forceUpdate(resolve);
237
+ });
238
238
  });
239
239
  });
240
- always(promise, delay).then(function () {
240
+ always(promise || delay(), function () {
241
241
  app.emit('pageenter', element, { pathname: context.page.path, view: V }, true);
242
242
  });
243
243
  self.views.shift();
@@ -264,7 +264,7 @@ definePrototype(ViewContainer, Component, {
264
264
  }) || props.defaultView;
265
265
  }
266
266
  });
267
- fill(ViewContainer.prototype, 'abort onRender setActive setPage unmountView', noop);
267
+ fill(ViewContainer.prototype, 'abort setActive setPage unmountView', noop);
268
268
 
269
269
  function normalizePart(value, part) {
270
270
  return isUndefinedOrNull(value) || value === '' || value === part ? '' : value[0] === part ? value : part + value;