Plug format now changed to YAML
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { SysCallMapping } from "../system";
|
||||
import { EventFeature } from "../feature/event";
|
||||
|
||||
export function eventSyscalls(eventFeature: EventFeature): SysCallMapping {
|
||||
return {
|
||||
async dispatch(ctx, eventName: string, data: any) {
|
||||
return eventFeature.dispatchEvent(eventName, data);
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -3,11 +3,11 @@ import { SysCallMapping } from "../system";
|
||||
|
||||
export function fetchSyscalls(): SysCallMapping {
|
||||
return {
|
||||
async fetchJson(ctx, url: RequestInfo, init: RequestInit) {
|
||||
async json(ctx, url: RequestInfo, init: RequestInit) {
|
||||
let resp = await fetch(url, init);
|
||||
return resp.json();
|
||||
},
|
||||
async fetchText(ctx, url: RequestInfo, init: RequestInit) {
|
||||
async text(ctx, url: RequestInfo, init: RequestInit) {
|
||||
let resp = await fetch(url, init);
|
||||
return resp.text();
|
||||
},
|
||||
|
||||
@@ -12,7 +12,6 @@ test("Test store", async () => {
|
||||
let plug = await system.load(
|
||||
"test",
|
||||
{
|
||||
hooks: {},
|
||||
functions: {
|
||||
test1: {
|
||||
code: `(() => {
|
||||
|
||||
@@ -28,7 +28,6 @@ test("Test store", async () => {
|
||||
let plug = await system.load(
|
||||
"test",
|
||||
{
|
||||
hooks: {},
|
||||
functions: {
|
||||
test1: {
|
||||
code: `(() => {
|
||||
|
||||
Reference in New Issue
Block a user