Documentation ¶
Index ¶
- func Clone(target interface{}) (reflect.Value, error)
- type Action
- type Listener
- type SnapShot
- type Store
- func (s *Store) AddListener(path string) <-chan SnapShot
- func (s *Store) AddModifier(action string, modifier interface{}) error
- func (s *Store) Dispatch(action Action) error
- func (s *Store) GetState() (interface{}, error)
- func (s *Store) GetStateByPath(path string) (interface{}, error)
- func (s *Store) Patch(path string, payload interface{}) error
- func (s *Store) RemoveListener(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
Store main struct
func NewStore ¶
func NewStore(initState interface{}) *Store
NewStore creates a new store based on a state
func (*Store) AddListener ¶
AddListener returns a channel to changes according to a path
func (*Store) AddModifier ¶
AddModifier adds a func that modifies the state, according to a Action name
func (*Store) GetStateByPath ¶
GetStateByPath get copies of the current state according to a path
func (*Store) RemoveListener ¶
RemoveListener removes and close the listener channel
Click to show internal directories.
Click to hide internal directories.