@yannosay/sinth 0.16.0 → 0.16.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/README.md +2 -2
- package/package.json +1 -1
- package/src/core/compiler.ts +7 -4
package/README.md
CHANGED
|
@@ -133,7 +133,7 @@ Button(onClick: isFullscreen = !isFullscreen, fullscreen: isFullscreen, fullscre
|
|
|
133
133
|
Without fullscreenSync, pressing Escape exits fullscreen but the variable stays true.
|
|
134
134
|
With it, Escape resets the variable to false — button text updates automatically.
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
#### Opt-in DOM Diffing
|
|
137
137
|
|
|
138
138
|
Skip re-executing expressions when their variables haven't changed. Perfect for expensive calculations or side effects you only want to fire once.
|
|
139
139
|
|
|
@@ -149,7 +149,7 @@ Main {
|
|
|
149
149
|
Button(onClick: count = += 1) { "Increment" }
|
|
150
150
|
}
|
|
151
151
|
```
|
|
152
|
-
Count updates every click because count changed. The alert fires only on page load — zero dependencies means it's cached forever.
|
|
152
|
+
Count updates every click because count changed. The alert fires only on page load — zero dependencies means it's cached forever. Just a meta flag.
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
|
package/package.json
CHANGED
package/src/core/compiler.ts
CHANGED
|
@@ -1071,10 +1071,13 @@ export function buildRuntime(opts: {
|
|
|
1071
1071
|
let vars = [];
|
|
1072
1072
|
syncedEls.forEach(function(el) { vars.push(el.dataset.sinthFullscreenSync); });
|
|
1073
1073
|
document.addEventListener('fullscreenchange', function() {
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1074
|
+
let state = !!document.fullscreenElement;
|
|
1075
|
+
vars.forEach(function(varName) {
|
|
1076
|
+
switch(varName) {
|
|
1077
|
+
${[...new Set(varDecls.filter(v => v.name).map(v => `case '${v.name}': ${v.name} = state; break;`))].join('\n ')}
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
sinthRender();
|
|
1078
1081
|
});
|
|
1079
1082
|
}
|
|
1080
1083
|
})();`;
|