Documentation
¶
Index ¶
- func Match[T, U any](resource Resource[T], onLoading func() U, onError func(error) U, ...) U
- func MatchOnData[T, U any](resource Resource[T], onData func(T) U, defaultValue U) U
- func MatchOnDataLazy[T, U any](resource Resource[T], onData func(T) U, defaultValue func() U) U
- func MatchOnError[T, U any](resource Resource[T], onError func(error) U, defaultValue U) U
- func MatchOnErrorLazy[T, U any](resource Resource[T], onError func(error) U, defaultValue func() U) U
- func MatchOnLoading[T, U any](resource Resource[T], onLoading func() U, defaultValue U) U
- func MatchOnLoadingLazy[T, U any](resource Resource[T], onLoading func() U, defaultValue func() U) U
- func MatchPartial[T, U any](resource Resource[T], options ...MatchOption[T, U]) maybe.Maybe[U]
- type MatchOption
- type MatchOptions
- type Resource
- func FlatMapData[T, U any](resource Resource[T], fn func(T) Resource[U]) Resource[U]
- func MapData[T, U any](resource Resource[T], fn func(T) U) Resource[U]
- func MapError[T any](resource Resource[T], fn func(error) error) Resource[T]
- func ResourceError[T any](err error) Resource[T]
- func ResourceLoading[T any]() Resource[T]
- func ResourceSuccess[T any](data T) Resource[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchOnData ¶ added in v0.1.95
func MatchOnDataLazy ¶ added in v0.1.95
func MatchOnError ¶ added in v0.1.95
func MatchOnErrorLazy ¶ added in v0.1.95
func MatchOnLoading ¶ added in v0.1.95
func MatchOnLoadingLazy ¶ added in v0.1.95
func MatchPartial ¶
func MatchPartial[T, U any](resource Resource[T], options ...MatchOption[T, U]) maybe.Maybe[U]
Types ¶
type MatchOption ¶
type MatchOption[T, U any] func(*MatchOptions[T, U])
func WithDefault ¶
func WithDefault[T, U any](onDefault func() U) MatchOption[T, U]
func WithOnData ¶
func WithOnData[T, U any](onData func(T) U) MatchOption[T, U]
func WithOnError ¶
func WithOnError[T, U any](onError func(error) U) MatchOption[T, U]
func WithOnLoading ¶
func WithOnLoading[T, U any](onLoading func() U) MatchOption[T, U]
type MatchOptions ¶
type MatchOptions[T, U any] struct { // contains filtered or unexported fields }
type Resource ¶
func FlatMapData ¶
func ResourceError ¶
func ResourceLoading ¶
func ResourceSuccess ¶
Click to show internal directories.
Click to hide internal directories.