I'm not sure I understand that last paragraph: `fi...
# clikt
a
I'm not sure I understand that last paragraph:
findOrSetObject
will set the object on the context it's called on if it can't find one. It will never affect a parent context. As far as changing the parent object, there isn't anything built in. I think the best approach would be to make the context object itself mutable. Something like
class Ctx(var state: MyState)
, then
val ctx by requireObject<Ctx>()
and
ctx.state = newState
.