Skip to content

Instantly share code, notes, and snippets.

@azenla
Last active December 9, 2015 19:00
Show Gist options
  • Save azenla/fdd84a9a1b7a90326e51 to your computer and use it in GitHub Desktop.
Save azenla/fdd84a9a1b7a90326e51 to your computer and use it in GitHub Desktop.
let names = [
"Alex"
"Sam"
"Logan"
]
let ages = [
16
18
16
]
for name in names and age in ages {
print("$(name): $(age)")
}
let callback = { -> print("Callback called!") }
EventLoop.run(callback)
let bus = EventBus()
bus.on("message") { message ->
print("Got Message: $(message)")
}
// Manual memory management
free(bus)
bus.emit("message", "Hello World")
// With Invoke
with "message" and "Hello World" invoke bus.emit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment