@tilia/react 5.0.1 → 5.1.0
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/index.d.ts +8 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import type { Tilia } from "tilia";
|
|
2
2
|
export interface TiliaReact {
|
|
3
|
+
/** Call at the top of a React component to enable reactive tracking. Prefer `leaf` instead. */
|
|
3
4
|
useTilia: () => void;
|
|
4
|
-
|
|
5
|
+
/** Compute a value and only re-render when the result changes, not the dependencies. */
|
|
6
|
+
useComputed: <T>(fn: () => T) => T;
|
|
7
|
+
/** Wrap a React component for exact dependency tracking (preferred over `useTilia`). */
|
|
5
8
|
leaf: <T, U>(fn: (p: T) => U) => (p: T) => U;
|
|
6
9
|
}
|
|
7
10
|
|
|
11
|
+
/** Create a `@tilia/react` API from a tilia context. */
|
|
8
12
|
export function make(tilia: Tilia): TiliaReact;
|
|
9
13
|
|
|
14
|
+
/** Call at the top of a React component to enable reactive tracking. Prefer `leaf` instead. */
|
|
10
15
|
export function useTilia(): void;
|
|
16
|
+
/** Compute a value and only re-render when the result changes, not the dependencies. */
|
|
11
17
|
export function useComputed<T>(fn: () => T): T;
|
|
18
|
+
/** Wrap a React component for exact dependency tracking (preferred over `useTilia`). */
|
|
12
19
|
export function leaf<T, U>(fn: (p: T) => U): (p: T) => U;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tilia/react",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"homepage": "https://tiliajs.com",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
"react": "*"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"tilia": "^5.
|
|
33
|
+
"tilia": "^5.1"
|
|
34
34
|
}
|
|
35
35
|
}
|