You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-14Lines changed: 27 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
UIElement - the "look ma, no JS framework!" library bringing signals-based reactivity to vanilla Web Components
4
4
5
-
Version 0.7.2
5
+
Version 0.7.3
6
6
7
7
## What is UIElement?
8
8
@@ -16,7 +16,7 @@ In the `connectedCallback()` you setup references to inner elements, add event l
16
16
17
17
`UIElement` is fast. In fact, faster than any JavaScript framework. Only direct fine-grained DOM updates in vanilla JavaScript can beat its performance. But then, you have no loose coupling of components and need to parse attributes and track changes yourself. This tends to get tedious and messy rather quickly. `UIElement` provides a structured way to keep your components simple, consistent and self-contained.
18
18
19
-
`UIElement` is tiny. 1 kB gzipped over the wire. And it has zero dependiences. If you want to understand how it works, you have to study the source code of [one single file](./index.js).
19
+
`UIElement` is tiny. 889 bytes gzipped over the wire. And it has zero dependiences. If you want to understand how it works, you have to study the source code of [one single file](./index.js).
20
20
21
21
That's all.
22
22
@@ -174,10 +174,10 @@ class MotionContext extends UIElement {
If you use `effect()` with a callback function like `() => doMyEffectWork()`, it will do all work synchronously in the tracking phase of the effect. That might not be ideal for several reasons:
202
+
If you use `effect()` with a callback function like `() => doMyEffectWork()`, it will do all work synchronously. That might not be ideal for several reasons:
203
203
204
204
- If effect work is expensive and takes more time than a single tick, not all DOM updates of the effect might happen concurrently.
205
205
- If you `set()` a signal which is used in the effect, you risk producing an infite loop.
@@ -246,7 +246,7 @@ It consists of three functions:
246
246
-`derive()` returns a getter function for the current value of the derived computation
247
247
-`effect()` accepts a callback function to be exectuted when used signals change
248
248
249
-
Cause & Effect is possibly the simplest way to turn JavaScript into a reactive language – with just 385 bytes gezipped code. By default, Cause & Effect doesn't do any memoization for derived signals but recalculates their current value each time. Contrary to general expectations, this seems to be faster in most cases. If you however are performing expensive work in computed signals or rely on count of the execution times, you should turn memoization on, by setting the second parameter of `derive()` to `true`.
249
+
Cause & Effect is possibly the simplest way to turn JavaScript into a reactive language – with just 386 bytes gezipped code. By default, Cause & Effect doesn't do any memoization for derived signals but recalculates their current values each time. Contrary to general expectations, this seems to be faster in most cases. If you however are performing expensive work in computed signals or rely on the count of execution times, you should turn memoization on, by setting the second parameter of `derive()` to `true`.
250
250
251
251
#### Usage Example
252
252
@@ -292,7 +292,16 @@ The last option comes with a bit more library code (around 1.6 kB gzipped), but
0 commit comments