Open illicitonion opened 1 month ago
The journey I've typically used to explain this is:
With
-prefixed functions (and maybe contrast with other persistent data structures / builders / ...)WithValue
with a user ID as an exampleWithTimeout
and Done
as just a library written using WithValue
.@bazmurphy had also encountered React's Context hooks which implement a similar pattern.
that is a good thought, IMO. I am sure we must be using timeout somewhere. we certainly have material on the need for timeouts in the primer, don't we? i think we could probably weave this into at least one of the exercises. maybe with some explicit demos of client cancellation as well, and a description of why that's useful.
Both of our Cohort 2 trainees have raised existential questions around Context. We may want to find some useful references or write up some material about this.
We may even want to make a "implement
WithTimeout
usingWithValue
" exercise to show that there's no magic here, it's really just a fancy key-value store.(I've also gone on a tangent around persistent data structures when talking through this, unclear whether that's actually useful/worthwhile :))