AJ Alt
11/24/2021, 9:03 PMfindOrSetObject
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
.