Skip to content

Optional store & Dependent state #543

Answered by stephencelis
DavidKmn asked this question in Q&A
Discussion options

You must be logged in to vote

@DavidKmn store.ifLet is precisely the tool for turning a store of optional state into a store of non-optional state:

The subscription block emits whenever the state switches from nil to non-nil and vice versa, so you can create or tear down this optional view accordingly.

You can find more example uses in the TicTacToe demo application in this repo.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DavidKmn
Comment options

@DavidKmn
Comment options

Answer selected by DavidKmn
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