Update.
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "scheduler" for Scheduler, Future
|
||||
|
||||
var moduleDouble = async { |x| x * 2 }
|
||||
var moduleAdd = async { |a, b| a + b }
|
||||
|
||||
class Helper {
|
||||
static useModuleVar(x) {
|
||||
return await moduleDouble(x)
|
||||
}
|
||||
|
||||
static combineModuleVars(a, b) {
|
||||
return await moduleAdd(await moduleDouble(a), await moduleDouble(b))
|
||||
}
|
||||
}
|
||||
|
||||
System.print(await moduleDouble(10)) // expect: 20
|
||||
System.print(Helper.useModuleVar(15)) // expect: 30
|
||||
System.print(Helper.combineModuleVars(5, 10)) // expect: 30
|
||||
Reference in New Issue
Block a user