eventemitter

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2019 License: MIT Imports: 2 Imported by: 6

README

Go Event Emitter Last release Documentation

Go Report Card

Branch Status Coverage
master Build Status Coveralls

go-eventemitter is the little and lightweight event emitter library for Go.

Example

package main

import "github.com/euskadi31/go-eventemitter"

func main() {
    emitter := eventemitter.New()

    emitter.Subscribe("test", func() {
        // code
    })

    emitter.Subscribe("count", func(i int) {
        // code
    })

    emitter.Dispatch("test")

    emitter.Dispatch("count", 42)

    emitter.Wait()
}

License

go-eventemitter is licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventEmitter

type EventEmitter interface {
	Subscribe(name string, listener interface{})

	Unsubscribe(name string, listener interface{})

	Dispatch(name string, args ...interface{})

	Wait()
}

EventEmitter interface

func New

func New() EventEmitter

New EventEmitter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL