MiniStateBuilder provides a fluent API for creating MiniState instances with a clean, chainable syntax. It simplifies the process of configuring a MiniState and handles cleanup automatically via DestroyRef.
MiniStateBuilder.Create()
CreateWithInput()
CreateWithObservableInput()
CreateWithSignalInput()
.setSuccessMsgFn(...)
.setErrorMsgFn(...)
.trigger()
MiniState manages state automatically
Creates a MiniState for operations that don't require input parameters (e.g., "get all" operations). The trigger function takes no parameters.
Creates a MiniState for operations that require input parameters (e.g., "get by id" or "filtered search"). The trigger function takes one parameter of type Input.
Creates a MiniState that automatically triggers whenever the input$ Observable emits a new value. Ideal for reacting to router parameters, form values, or other reactive data sources.
Creates a MiniState that automatically triggers whenever the input$ Signal changes. Similar to CreateWithObservableInput but for Angular's Signal primitive.
MiniStateBuilder automatically injects DestroyRef and sets up proper cleanup when the component is destroyed. This means you don't need to manually call unsubscribe() - subscriptions are managed for you.
A weather component that loads current weather data without input parameters: