Skip to content
Discussion options

You must be logged in to vote

You can create your store with no reducer to represent a completely inert store that does nothing when you send actions to it. That allows you to craft whatever you state you want and just hand it to the view.

This is how it can look:

let store = StoreOf<HomeFeature>(initialState: .init(error: error), reducer: EmptyReducer())

Or if you are using the newest version of TCA that allows specifying the reducer in a trailing builder closure:

let store = StoreOf<HomeFeature>(initialState: .init(error: error)) {
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@TiagoSantosSilva
Comment options

Answer selected by TiagoSantosSilva
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants