[MGNLUI-4996] Allow view context auto-creation Created: 04/Feb/19  Updated: 17/Apr/19  Resolved: 17/Apr/19

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1

Type: Task Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Epic Link: UI framework: basic features
Story Points: 5

 Description   

View contexts are useful concept when it comes to sharing the state of the UI: the parent view may bind and share a context, child views - inject/subscribe to/mutate it.

However, for better re-usability of the views, we should avoid explicitly creating the contexts in the view logic: what if in the other scenario the current root view is just a sub-view of smth even more massive that would also rely on the same context?

As a solution to this we can let the views inject even not yet created contexts - just instantiate and bind them on the fly upon injection.

Expected result:

  • a view can use/own without claiming ownership explicitly (i.e. by just injecting them).

Generated at Mon Feb 12 09:22:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.