mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
17 lines
227 B
V
17 lines
227 B
V
module main
|
|
|
|
import (
|
|
some_module
|
|
eventbus
|
|
)
|
|
|
|
fn main(){
|
|
mut sub := some_module.get_subscriber()
|
|
sub.subscribe("error", on_error)
|
|
some_module.do_work()
|
|
}
|
|
|
|
fn on_error(p eventbus.Params) {
|
|
println(p.get_string("error"))
|
|
}
|