rask-ui 0.24.0 → 0.24.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.
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +10 -17
- package/package.json +1 -1
package/dist/component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAsB,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAMrE,wBAAgB,mBAAmB,mCAElC;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,IAAI,QAM5C;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,IAAI,QAMxC;AAED,MAAM,MAAM,8BAA8B,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,IAC3D,CAAC,MAAM,KAAK,CAAC,GACb,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,CAAC;AAE1B,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,IAC1D,CAAC,MAAM,MAAM,KAAK,CAAC,GACnB,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,KAAK,CAAC,CAAC;AAEhC,qBAAa,aAAa,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAC3D,QAAQ,EAAE,8BAA8B,CAAC,CAAC,CAAC,CAAC;IACpD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAC1C,OAAO,CAAC,aAAa,CAAc;IAwBnC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAS;IAE9B,QAAQ,WAOL;IAEH,WAAW,UAAS;IACpB,OAAO,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAM;IAC3D,QAAQ,gBAAa;IACrB,eAAe;IAcf,QAAQ,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAM;IACjC,UAAU,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAM;IAEnC,iBAAiB,IAAI,IAAI;IAGzB,oBAAoB,IAAI,IAAI;IAI5B,yBAAyB,CACvB,SAAS,EAAE,QAAQ,CAAC;QAAE,QAAQ,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,CAAC,CAAC,GAClD,IAAI;IAcP,qBAAqB,IAAI,OAAO;IAMhC,MAAM;CA4CP"}
|
package/dist/component.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component
|
|
1
|
+
import { Component } from "inferno";
|
|
2
2
|
import { getCurrentObserver, Observer, Signal } from "./observation";
|
|
3
3
|
import { syncBatch } from "./batch";
|
|
4
4
|
import { CatchErrorContext } from "./useCatchError";
|
|
@@ -98,33 +98,26 @@ export class RaskComponent extends Component {
|
|
|
98
98
|
render() {
|
|
99
99
|
currentComponent = this;
|
|
100
100
|
const stopObserving = this.observer.observe();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
try {
|
|
102
|
+
if (!this.renderFn) {
|
|
103
|
+
this.reactiveProps = createReactiveProps(this);
|
|
104
104
|
const component = this.props.__component;
|
|
105
105
|
const renderFn = component(this.reactiveProps);
|
|
106
106
|
if (typeof renderFn === "function") {
|
|
107
|
+
// Since we ran a setup function we need to clear any signals accessed
|
|
108
|
+
this.observer.clearSignals();
|
|
107
109
|
this.renderFn = renderFn;
|
|
108
110
|
}
|
|
109
111
|
else {
|
|
110
112
|
this.renderFn = component;
|
|
111
|
-
|
|
112
|
-
this.observer.clearSignals();
|
|
113
|
+
return renderFn;
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
|
|
116
|
-
if (typeof this.context.notifyError !== "function") {
|
|
117
|
-
throw error;
|
|
118
|
-
}
|
|
119
|
-
this.context.notifyError(error);
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
let result = null;
|
|
124
|
-
try {
|
|
116
|
+
let result = null;
|
|
125
117
|
this.isRendering = true;
|
|
126
118
|
result = this.renderFn(this.reactiveProps);
|
|
127
119
|
this.isRendering = false;
|
|
120
|
+
return result;
|
|
128
121
|
}
|
|
129
122
|
catch (error) {
|
|
130
123
|
const notifyError = CatchErrorContext.use();
|
|
@@ -132,12 +125,12 @@ export class RaskComponent extends Component {
|
|
|
132
125
|
throw error;
|
|
133
126
|
}
|
|
134
127
|
notifyError(error);
|
|
128
|
+
return null;
|
|
135
129
|
}
|
|
136
130
|
finally {
|
|
137
131
|
stopObserving();
|
|
138
132
|
currentComponent = undefined;
|
|
139
133
|
}
|
|
140
|
-
return result;
|
|
141
134
|
}
|
|
142
135
|
}
|
|
143
136
|
function createReactiveProps(comp) {
|