redux

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	With(interface{}) Action
	GetPayload() reflect.Value
	SetPayloadType(reflect.Type)
	GetType() string
}

type ActionsObject

type ActionsObject interface {
	GetActions() []Action
	GetActionsNames() []string
	Contains(action Action) bool
	ContainsByName(actionName string) bool
	GetActionByName(name string) Action
}

func NewActionsObject

func NewActionsObject(catcher errors.ErrorCatcher, actions interface{}) ActionsObject

type ActionsObjectFactory added in v1.1.0

type ActionsObjectFactory interface {
	Create(actions interface{}) ActionsObject
}

func NewActionsObjectFactory added in v1.1.0

func NewActionsObjectFactory(container dependencyinjection.Container) ActionsObjectFactory

type BusinesParamBuilder added in v1.0.0

type BusinesParamBuilder interface {
	SetInitialState(interface{}) BusinesParamBuilder
	SetActions(interface{}) BusinesParamBuilder
	SetSelector(selector string) BusinesParamBuilder
	On(action Action, function interface{}) BusinesParamBuilder
	SetActionsLogicByObject(object interface{}) BusinesParamBuilder
	GetBusinessParam() BusinessParam
}

func NewBusinessParamBuilder added in v0.0.22

func NewBusinessParamBuilder(logger logs.Logger, aactionsObjectFactory ActionsObjectFactory, businessParamFactory BusinessParamFactory) BusinesParamBuilder

type BusinessParam added in v0.0.22

type BusinessParam interface {
	GetActionsObject() ActionsObject
	GetReducer() Reducer
	GetInitialState() interface{}
	GetSelector() string
}

func NewBusinessParam added in v0.0.22

func NewBusinessParam(initialState interface{}, reducer Reducer, actionObject ActionsObject, selector string) BusinessParam

type BusinessParamFactory added in v1.1.0

type BusinessParamFactory interface {
	Create(parameter BusinessParamFactoryParamter) BusinessParam
}

func NewBusinessParamFactory added in v1.1.0

func NewBusinessParamFactory(container dependencyinjection.Container) BusinessParamFactory

type BusinessParamFactoryParamter added in v1.1.0

type BusinessParamFactoryParamter struct {
	InitialState  interface{}
	Reducer       Reducer
	ActionsObject ActionsObject
	Selector      string
}

type Reducer

type Reducer *func(state interface{}, action Action) interface{}

type StateManagement added in v1.1.0

type StateManagement interface {
	Subscribe(subscription *func(state interface{}))
	UnSubscribe(subscription *func(state interface{}))
	GetState() interface{}
	SetState(newState interface{})
}

func NewStateManager added in v1.1.0

func NewStateManager(initialState interface{}, selector string, storePublisher eventsmanager.Publisher, subscriptions eventsmanager.Subscriptions, selectorPublisher eventsmanager.Publisher) StateManagement

type StateManagementFactory added in v1.1.0

type StateManagementFactory interface {
	Create(parameter StateManagementFactoryParamter) StateManagement
}

func NewStateManagementFactory added in v1.1.0

func NewStateManagementFactory(container dependencyinjection.Container) StateManagementFactory

type StateManagementFactoryParamter added in v1.1.0

type StateManagementFactoryParamter struct {
	InitialState   interface{}
	Selector       string
	StorePublisher eventsmanager.Publisher
}

type Store

type Store interface {
	GetState() interface{}
	Dispatch(Action)
	Subscribe(*func())
	Unsubscribe(*func())
	AddReducer(BusinessParam)
	RemoveReducer(string)
	GetStateOf(string) interface{}
	SubscribeTo(string, *func(interface{}))
	UnsubscribeFrom(string, *func(interface{}))
}

func NewStore

func NewStore(errorDefer errors.ErrorDefer, subscriptions eventsmanager.Subscriptions, publisher eventsmanager.Publisher, stateManagementFactory StateManagementFactory) Store

type StoreError added in v1.0.0

type StoreError interface {
	errors.CustomError
	GetErrorType() StoreErrorType
}

type StoreErrorType added in v1.0.0

type StoreErrorType uint8
const (
	UnexpectedStoreError StoreErrorType = iota
	AnyReducerForThisActionError
	EmptySelectorError
	AnyStateBySelectorError
	MultipleReducerForSelectorError
	MultipleReducerForActionsObjectError
)

Directories

Path Synopsis
ioc

Jump to

Keyboard shortcuts

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