@isoloop/preact 0.1.0 → 0.1.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/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ type UseTopicOptions = {
|
|
|
63
63
|
* the last one subscribed gets records, and the first stops updating. When the last one
|
|
64
64
|
* unmounts, the topic has no subscription, and the first doesn't get it back. Call
|
|
65
65
|
* `useTopic` once per topic, and pass the value down as props or share it through context.
|
|
66
|
+
* With the kernel's `dev: true`, the bus warns in the console when this happens.
|
|
66
67
|
*
|
|
67
68
|
* @param topic - The topic to read. The isolate needs a subscribe grant for it.
|
|
68
69
|
* @param opts - Where reading starts ({@link UseTopicOptions}).
|
|
@@ -101,9 +102,9 @@ export declare function usePublish<In>(topic: TopicRef<In, any, any, any>): (val
|
|
|
101
102
|
*/
|
|
102
103
|
export declare function useRequest<In, ROut>(topic: TopicRef<In, any, any, ROut>): (value: In, opts?: RequestOptions$1) => Promise<ROut>;
|
|
103
104
|
/**
|
|
104
|
-
* The isolate's host calls (`ctx.host`): `measure`, `focus`, `scrollIntoView`
|
|
105
|
-
* `
|
|
106
|
-
* them, after pending changes are applied.
|
|
105
|
+
* The isolate's host calls (`ctx.host`): `measure`, `focus`, `scrollIntoView`, `navigate`
|
|
106
|
+
* and `requestCanvas`. Pass them the elements a ref holds; the host acts on what it
|
|
107
|
+
* rendered for them, after pending changes are applied.
|
|
107
108
|
*
|
|
108
109
|
* @returns The host API.
|
|
109
110
|
* @throws `Error` outside a component that `defineIsolate` rendered.
|
package/dist/index.js
CHANGED
|
@@ -134,6 +134,7 @@ function defineIsolate(Component) {
|
|
|
134
134
|
* the last one subscribed gets records, and the first stops updating. When the last one
|
|
135
135
|
* unmounts, the topic has no subscription, and the first doesn't get it back. Call
|
|
136
136
|
* `useTopic` once per topic, and pass the value down as props or share it through context.
|
|
137
|
+
* With the kernel's `dev: true`, the bus warns in the console when this happens.
|
|
137
138
|
*
|
|
138
139
|
* @param topic - The topic to read. The isolate needs a subscribe grant for it.
|
|
139
140
|
* @param opts - Where reading starts ({@link UseTopicOptions}).
|
|
@@ -197,9 +198,9 @@ function useRequest(topic) {
|
|
|
197
198
|
}
|
|
198
199
|
// src/hooks/host.ts
|
|
199
200
|
/**
|
|
200
|
-
* The isolate's host calls (`ctx.host`): `measure`, `focus`, `scrollIntoView`
|
|
201
|
-
* `
|
|
202
|
-
* them, after pending changes are applied.
|
|
201
|
+
* The isolate's host calls (`ctx.host`): `measure`, `focus`, `scrollIntoView`, `navigate`
|
|
202
|
+
* and `requestCanvas`. Pass them the elements a ref holds; the host acts on what it
|
|
203
|
+
* rendered for them, after pending changes are applied.
|
|
203
204
|
*
|
|
204
205
|
* @returns The host API.
|
|
205
206
|
* @throws `Error` outside a component that `defineIsolate` rendered.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isoloop/preact",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Preact for Isoloop: run a component as an isolate in a worker, with hooks for the message bus and the host.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isoloop",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"preact": "^10 || ^11"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@isoloop/protocol": "0.1.
|
|
36
|
-
"@isoloop/runtime": "0.1.
|
|
35
|
+
"@isoloop/protocol": "0.1.1",
|
|
36
|
+
"@isoloop/runtime": "0.1.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@isoloop/dom": "0.1.
|
|
39
|
+
"@isoloop/dom": "0.1.1",
|
|
40
40
|
"preact10": "npm:preact@10.29.8",
|
|
41
41
|
"preact11": "npm:preact@11.1.1",
|
|
42
42
|
"typescript": "7.0.2"
|