mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 08:54:05 +00:00
Use async functions in wasm imports (#28)
* Use async functions in wasm imports * Complete implementing asyncify with assemblyscript loader
This commit is contained in:
@@ -34,10 +34,21 @@ import {
|
||||
// Wrapped
|
||||
} from '@graphprotocol/graph-ts';
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
export declare namespace test {
|
||||
export function asyncMethod(): i32;
|
||||
}
|
||||
|
||||
export function callGraphAPI (): void {
|
||||
log.debug('hello {}', ['world']);
|
||||
}
|
||||
|
||||
export function callAsyncMethod (): void {
|
||||
log.debug('calling async method', []);
|
||||
const res = test.asyncMethod();
|
||||
log.debug('res after async: {}', [res.toString()]);
|
||||
}
|
||||
|
||||
export class Foo {
|
||||
static getFoo (): Foo {
|
||||
return new Foo();
|
||||
@@ -49,3 +60,15 @@ export class Foo {
|
||||
}
|
||||
|
||||
export const FooID = idof<Foo>();
|
||||
|
||||
export class Bar {
|
||||
prop: string
|
||||
|
||||
constructor (prop: string) {
|
||||
this.prop = prop;
|
||||
}
|
||||
|
||||
getProp (): string {
|
||||
return this.prop;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user