Skip to content

Commit 31fb63f

Browse files
committed
✨ Ensure we always render with a valid store
This safeguards the component against overridden render() methods by performing dirty checking a second time before actually triggering the rendering.
1 parent 6a2fbcb commit 31fb63f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fit-html",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"description": "5KB functional Web Components without bloat",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/connect.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ export default function connect<S, SP, DP, OP = {}>(
162162
this._renderEnqueued = true;
163163
Promise.resolve().then(() => {
164164
this._renderEnqueued = false;
165-
this.render();
165+
if (this._isConnected) {
166+
this.render();
167+
}
166168
});
167169
}
168170

0 commit comments

Comments
 (0)