mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2024-12-05 02:10:18 +00:00
Fix types
This commit is contained in:
parent
5b3fe66d8c
commit
c3eba6a73c
@ -264,6 +264,8 @@ export interface ServiceDef {
|
||||
* List of functions which the service consists of
|
||||
*/
|
||||
functions:
|
||||
| LabeledProductType<ArrowType<LabeledProductType<SimpleTypes>>>
|
||||
| LabeledProductType<
|
||||
ArrowType<LabeledProductType<SimpleTypes> | UnlabeledProductType>
|
||||
>
|
||||
| NilType;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import {
|
||||
NonArrowSimpleType,
|
||||
ScalarType,
|
||||
SimpleTypes,
|
||||
UnlabeledProductType,
|
||||
} from "@fluencelabs/interfaces";
|
||||
|
||||
import { ParticleContext } from "../jsServiceHost/interfaces.js";
|
||||
@ -203,7 +204,9 @@ export function js2aqua(
|
||||
|
||||
export const wrapFunction = (
|
||||
func: ServiceImpl[string],
|
||||
schema: ArrowWithoutCallbacks | ArrowType<LabeledProductType<SimpleTypes>>,
|
||||
schema:
|
||||
| ArrowWithoutCallbacks
|
||||
| ArrowType<LabeledProductType<SimpleTypes> | UnlabeledProductType>,
|
||||
): ServiceImpl[string] => {
|
||||
return async (...args) => {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
|
@ -548,7 +548,7 @@ export abstract class FluencePeer {
|
||||
) == null
|
||||
) {
|
||||
// try to finish script if fire-and-forget enabled
|
||||
item.onSuccess({});
|
||||
item.onSuccess(null);
|
||||
}
|
||||
})
|
||||
.catch((e: unknown) => {
|
||||
@ -638,7 +638,9 @@ export abstract class FluencePeer {
|
||||
) == null
|
||||
) {
|
||||
// try to finish script if fire-and-forget enabled
|
||||
item.onSuccess({});
|
||||
setTimeout(() => {
|
||||
item.onSuccess(null);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user