-
On JS-frontend, I've figured out that I can reference a function that's been exported in a child like this: parent script: Utils.someFunc()
Second -- is it possible to export multiple functions from a backend script? I see in the tasks example that reconcileAssignments is module.exports = async function, which implies the type of module.exports is a function. I tried module.exports = { key: async function blah() } but that doesn't work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello,
No, not possible ATM. I've been thinking about being able to define module dependencies using relation but it was just never necessary. Cloning seems to work quite well for this and you can nicely see the dependency tree.
No, you need to use the child note name. I think it's good practice to explicitly specify the module name. Otherwise you can always do this: const {myFunc} = childModule; And then you can call it just like
Yes, that should work. Remember that it's JS so module.exports = {
myFunc: async () => {
}
} or: async function blah() {
...
}
async function bleh() {
...
}
module.exports = {
blah,
bleh
} |
Beta Was this translation helpful? Give feedback.
Hello,
No, not possible ATM. I've been thinking about being able to define module dependencies using relation but it was just never necessary. Cloning seems to work quite well for this and you can nicely see the dependency tree.
No, you need to use the child note name. I think it's good practice to explicitly specify the module name.
Otherwise you can always do this:
And then you can call it just like
myFunc()
instead ofchildModule.myFunc()