@isoloop/preact 0.1.0-next.8 → 0.1.0-next.9
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 +3 -6
- package/dist/index.js +1 -0
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BusError, HostApi, HostApi as HostApi$1, HostCallError, IsolateContext, IsolateContext as IsolateContext$1, IsolateDefinition } from "@isoloop/runtime";
|
|
1
|
+
import { BusError, HostApi, HostApi as HostApi$1, HostCallError, IsolateContext, IsolateContext as IsolateContext$1, IsolateDefinition, RequestOptions, RequestOptions as RequestOptions$1 } from "@isoloop/runtime";
|
|
2
2
|
import { ComponentType } from "preact";
|
|
3
3
|
import { RouteValue, RouteValue as RouteValue$1, StartPosition, TopicRef } from "@isoloop/protocol";
|
|
4
4
|
/** Props every isolate component gets: `manifest.config`, passed through. */
|
|
@@ -29,15 +29,12 @@ export declare function useTopic<Out>(topic: TopicRef<any, Out, any, any>, opts?
|
|
|
29
29
|
export declare function usePublish<In>(topic: TopicRef<In, any, any, any>): (value: In, opts?: {
|
|
30
30
|
key?: string;
|
|
31
31
|
}) => Promise<void>;
|
|
32
|
-
type RequestOptions = {
|
|
33
|
-
key?: string;
|
|
34
|
-
timeoutMs?: number;
|
|
35
|
-
};
|
|
36
32
|
/**
|
|
37
33
|
* A function that sends a request on `topic` and resolves with the reply.
|
|
38
34
|
* It rejects with a `BusError`, `timeout` after `timeoutMs` (default 30 s).
|
|
35
|
+
* @experimental
|
|
39
36
|
*/
|
|
40
|
-
export declare function useRequest<In, ROut>(topic: TopicRef<In, any, any, ROut>): (value: In, opts?: RequestOptions) => Promise<ROut>;
|
|
37
|
+
export declare function useRequest<In, ROut>(topic: TopicRef<In, any, any, ROut>): (value: In, opts?: RequestOptions$1) => Promise<ROut>;
|
|
41
38
|
/** `measure`, `focus`, `scrollIntoView` and `navigate`, as `ctx.host` has them. */
|
|
42
39
|
export declare function useHost(): HostApi$1;
|
|
43
40
|
/** The current route, or `undefined` until the first record arrives (or with routing off). */
|
package/dist/index.js
CHANGED
|
@@ -126,6 +126,7 @@ function usePublish(topic) {
|
|
|
126
126
|
/**
|
|
127
127
|
* A function that sends a request on `topic` and resolves with the reply.
|
|
128
128
|
* It rejects with a `BusError`, `timeout` after `timeoutMs` (default 30 s).
|
|
129
|
+
* @experimental
|
|
129
130
|
*/
|
|
130
131
|
function useRequest(topic) {
|
|
131
132
|
const { bus } = useIsolate();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isoloop/preact",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.9",
|
|
4
4
|
"description": "Preact adapter for Isoloop isolates: defineIsolate(Component) and bus and host hooks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"preact": "^10 || ^11"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@isoloop/protocol": "0.1.0-next.
|
|
27
|
-
"@isoloop/runtime": "0.1.0-next.
|
|
26
|
+
"@isoloop/protocol": "0.1.0-next.9",
|
|
27
|
+
"@isoloop/runtime": "0.1.0-next.9"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@isoloop/dom": "0.1.0-next.
|
|
30
|
+
"@isoloop/dom": "0.1.0-next.9",
|
|
31
31
|
"preact10": "npm:preact@10.29.8",
|
|
32
32
|
"preact11": "npm:preact@11.1.1",
|
|
33
33
|
"typescript": "7.0.2"
|