Closed brucou closed 4 years ago
Despite it isn't explicit on readme, it's already possible to write:
function getName(user) {
const effectName = 'ask_name';
let name = user.name;
if (name === null) {
name = perform effectName; // we are using a variable instead of a literal string
}
return name;
}
const arya = { name: null };
try {
const aryaName = getName(arya);
console.log('Arya name:', aryaName)
} handle (effect) {
if (effect === 'ask_name') {
await wait(1000);
resume 'Arya Stark';
}
}
Thank you for open new issues 😄
Given the syntax
perform String
with a string identifying the effect to be run how do you pass arguments to the matching effect handler?