lilact 0.9.1 → 0.10.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/lilact.development.js +279 -129
- package/dist/lilact.development.js.map +1 -1
- package/dist/lilact.development.min.js +1 -1
- package/dist/lilact.development.min.js.map +1 -1
- package/dist/lilact.production.min.js +1 -1
- package/dist/lilact.production.min.js.map +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/functions/errors.globalErrorHandler.html +3 -2
- package/docs/functions/errors.traceError.html +4 -3
- package/docs/functions/hooks.useImperativeHandle.html +1 -1
- package/docs/functions/misc.classNames.html +1 -1
- package/docs/functions/misc.deepEqual.html +1 -1
- package/docs/functions/misc.forwardRef.html +4 -0
- package/docs/functions/misc.getComponentByPointer.html +1 -1
- package/docs/functions/misc.isAsync.html +1 -1
- package/docs/functions/misc.isClass.html +1 -1
- package/docs/functions/misc.isEmpty.html +1 -1
- package/docs/functions/misc.isError.html +1 -1
- package/docs/functions/misc.isThenable.html +1 -1
- package/docs/functions/misc.shallowEqual.html +1 -1
- package/docs/functions/misc.toBool.html +1 -1
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.require.html +2 -2
- package/docs/functions/timers.timeoutPromise.html +2 -2
- package/docs/modules/hooks.html +1 -1
- package/docs/modules/misc.html +1 -1
- package/docs/static/demos/css-transition.jsx +1 -1
- package/docs/static/demos/error-boundary.jsx +8 -1
- package/docs/static/demos/modal.jsx +2 -1
- package/docs/static/demos/reducer.jsx +30 -23
- package/docs/static/demos/transition.jsx +2 -1
- package/docs/static/demos/usedeffered.jsx +33 -0
- package/docs/static/index.html +59 -30
- package/docs/static/lilact.development.js +279 -129
- package/docs/static/lilact.development.min.js +1 -1
- package/docs/static/lilact.production.min.js +1 -1
- package/package.json +1 -1
- package/root/demos/css-transition.jsx +1 -1
- package/root/demos/error-boundary.jsx +8 -1
- package/root/demos/modal.jsx +2 -1
- package/root/demos/reducer.jsx +30 -23
- package/root/demos/transition.jsx +2 -1
- package/root/demos/usedeffered.jsx +33 -0
- package/root/index.html +59 -30
- package/root/lilact.development.js +279 -129
- package/root/lilact.development.min.js +1 -1
- package/root/lilact.production.min.js +1 -1
- package/src/errors.jsx +36 -32
- package/src/events.jsx +194 -66
- package/src/hooks.jsx +0 -15
- package/src/jsx.js +1 -1
- package/src/lilact.jsx +21 -2
- package/src/misc.jsx +14 -0
- package/src/pane.jsx +2 -2
- package/src/run.jsx +4 -4
- package/src/timers.jsx +4 -4
- package/docs/functions/hooks.forwardRef.html +0 -4
- package/docs/static/demos/use-deffered.jsx +0 -30
- package/root/demos/use-deffered.jsx +0 -30
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const { useState, useDeferredValue } = Lilact;
|
|
2
|
-
|
|
3
|
-
function ExpensiveList({ query }) {
|
|
4
|
-
const items = Array.from({ length: 5000 }, (_, i) => `${query} item ${i}`);
|
|
5
|
-
return (
|
|
6
|
-
<ul>
|
|
7
|
-
{items.map((it) => (
|
|
8
|
-
<li key={it}>{it}</li>
|
|
9
|
-
))}
|
|
10
|
-
</ul>
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function Demo() {
|
|
15
|
-
const [q, setQ] = useState("");
|
|
16
|
-
const deferredQ = useDeferredValue(q, "loading...");
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div>
|
|
20
|
-
<input value={q} onChange={(e) => setQ(e.target.value)} placeholder="Type to search..." />
|
|
21
|
-
<p>Live: {q}</p>
|
|
22
|
-
<p>Deferred: {deferredQ}</p>
|
|
23
|
-
<div style={{ height: 300, overflow: "auto", border: "1px solid #ccc" }}>
|
|
24
|
-
<ExpensiveList query={deferredQ} />
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
module.exports = Demo;
|