gg_state

package
v0.2.38 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EventOnChangeState = "_on_change_state"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	// contains filtered or unexported fields
}

State simple state object that store data and emit events

func NewState

func NewState(name string) (instance *State)

func (*State) Events

func (instance *State) Events() *gg_events.Emitter

func (*State) Get

func (instance *State) Get(key string) interface{}

func (*State) GetState

func (instance *State) GetState() map[string]interface{}

func (*State) Name

func (instance *State) Name() string

func (*State) Off

func (instance *State) Off(eventName string, callback ...func(event *gg_events.Event)) *State

func (*State) OffStateChanged

func (instance *State) OffStateChanged(callback ...func(event *gg_events.Event)) *State

func (*State) On

func (instance *State) On(eventName string, callback func(event *gg_events.Event)) *State

func (*State) OnStateChanged

func (instance *State) OnStateChanged(callback func(event *gg_events.Event)) *State

func (*State) Put

func (instance *State) Put(key string, value interface{}) *State

func (*State) SetState

func (instance *State) SetState(m map[string]interface{}) *State

type StateHelper

type StateHelper struct {
}
var StateH *StateHelper

func (*StateHelper) New

func (instance *StateHelper) New(name string) *State

Jump to

Keyboard shortcuts

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