mirror of
https://github.com/beijaflor-io/ghcjs-commonjs.git
synced 2024-09-11 16:25:25 +03:00
19 lines
739 B
JavaScript
19 lines
739 B
JavaScript
const ghcjsRequire = require('./ghcjs-require');
|
|
const Main = ghcjsRequire('./Main.jsexe');
|
|
|
|
Main(({wrapped, exports, emitter}) => {
|
|
console.log('[javascript] Haskell runtime loaded!');
|
|
console.log('[javascript] Calling helloWorld...');
|
|
exports.helloWorld();
|
|
|
|
console.log('[javascript] Sending message to call launchTheMissiles...');
|
|
emitter.emit('ghcjs-require:runexport', 'launchTheMissiles', (err, x) => {
|
|
console.log(`[javascript] launchTheMissiles ended yielding: ${x}`);
|
|
|
|
console.log('[javascript] Running launchTheMissiles as wrapped function that returns promise');
|
|
wrapped.launchTheMissiles().then((x) => {
|
|
console.log(`[javascript] launchTheMissiles promised ended yielding: ${x}`);
|
|
});
|
|
});
|
|
});
|