get_it icon indicating copy to clipboard operation
get_it copied to clipboard

Add scopeName parameter to popScope

Open olexale opened this issue 3 years ago • 0 comments

Let's imagine an object (it could be a complex stateful widget, a page, or an anchor in AR) that has complex internal dependencies (object-scoped services, repositories, etc.). I found it highly convenient to push a separate named scope during this object creation and lazily initialize its dependencies. The problem is that, when the object dies, I cannot remove the scope without popping scopes that potentially were pushed on top of it, i.e. it is not possible to drop the scope B without dropping scope C as well:

[scope A] -> [scope B] -> [scope C]

With this PR I propose adding functionality that allows dropping any named scope from the stack.

olexale avatar Aug 25 '22 18:08 olexale