Skip to content

Commit 1318649

Browse files
committed
Export promise for the examples
This will let a test run the examples
1 parent fa49647 commit 1318649

12 files changed

+13
-12
lines changed

examples/01-hello-world.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ async function start() {
5353
events.map((event) => console.log(event.params!.data.green));
5454
}
5555

56-
start();
56+
export default start();
57+
5758
/*
5859
* OUTPUT:
5960
*

examples/02-nested-boolean-logic.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async function start() {
7878

7979
events.map((event) => console.log(event.params!.message.red));
8080
}
81-
start();
81+
export default start();
8282
/*
8383
* OUTPUT:
8484
*

examples/03-dynamic-facts.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async function start() {
7777
facts.accountId + " is a " + events.map((event) => event.params!.message),
7878
);
7979
}
80-
start();
80+
export default start();
8181

8282
/*
8383
* OUTPUT:

examples/04-fact-dependency.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async function start() {
145145
* for washington and jefferson after the initial data load.
146146
*/
147147
}
148-
start();
148+
export default start();
149149

150150
/*
151151
* OUTPUT:

examples/05-optimizing-runtime-with-fact-priorities.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async function start() {
105105
// define fact(s) known at runtime
106106
await engine.run();
107107
}
108-
start();
108+
export default start();
109109

110110
/*
111111
* OUTPUT:

examples/06-custom-operators.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async function start() {
101101
facts = { word: "antelope" };
102102
await engine.run(facts);
103103
}
104-
start();
104+
export default start();
105105

106106
/*
107107
* OUTPUT:

examples/07-rule-chaining.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async function start() {
147147
);
148148
}
149149

150-
start();
150+
export default start();
151151

152152
/*
153153
* OUTPUT:

examples/08-fact-comparison.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async function start() {
150150
facts = Object.assign({}, userFacts, productList);
151151
await engine.run(facts);
152152
}
153-
start();
153+
export default start();
154154
/*
155155
* OUTPUT:
156156
*

examples/09-rule-results.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async function start() {
9494
engine.run({ athlete: true, GPA: 1.1, username: "sarah" }),
9595
]);
9696
}
97-
start();
97+
export default start();
9898
/*
9999
* OUTPUT:
100100
*

examples/10-condition-sharing.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async function start() {
126126
await engine.run(facts);
127127
}
128128

129-
start();
129+
export default start();
130130

131131
/*
132132
* OUTPUT:

0 commit comments

Comments
 (0)