Skip to content

Commit c80e3aa

Browse files
committed
re-add streamData
accidentally removed during rebasing
1 parent 47162ef commit c80e3aa

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

typescript/packages/common-builder/src/built-in.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,27 @@ let fetchDataFactory:
3939
>
4040
| undefined = undefined;
4141

42+
export function streamData<T>(
43+
params: Value<{
44+
url: string;
45+
options?: RequestInit;
46+
result?: T;
47+
}>
48+
): Value<{ pending: boolean; result: T; error: any }> {
49+
streamDataFactory ||= createNodeFactory({
50+
type: "builtin",
51+
implementation: "streamData",
52+
});
53+
return streamDataFactory(params);
54+
}
55+
56+
let streamDataFactory:
57+
| NodeFactory<
58+
{ url: string; options?: RequestInit; result?: any },
59+
{ pending: boolean; result: any; error: any }
60+
>
61+
| undefined = undefined;
62+
4263
export function ifElse<T, U, V>(
4364
condition: Value<T>,
4465
ifTrue: Value<U>,

0 commit comments

Comments
 (0)