You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working with AI MCP it seems to be struggling with the task to create a Model aka ViewModel for a CustomControl-like View (inheriting from SKCanvasElement) and I honestly those problems it was facing while creating the Methods to interact with the State and ListState thrown up challenges I am also not able to solve.
So maybe someone has some answers and recommendations for those steps for us, which includes Copilot, which did 5x query the docs MCP resources and did end up with horrible messy/workaround heavy code, which I would like to clean up to a best practice adhering result 😅
1. How to initialize a non-Generic State for a non-nullable IState which doesn't provides the Empty Operator?
Core Problems:
IState<RecordType> MyState => State.Empty(this) -> State$${\color{red}.Empty(this)}$$ is not available
to initialize a non-generic State, we explicitly need a Value init here even if the IState<T> -> T is NOT nullable!
But this makes the State.SetAsync Operator not longer available
Copilot workaround for constant "possible null return" Compiler Warnings in the later UpdateAsync Operators
The Uno.Samples/UI/MVUX Sample MessengerModel uses a static builder in the record itself, which is cleaner maybe, but if we could have a Generic State with Empty Init, its hard to understand, why we can not with a non-generic one...
So I updated to generic State to get rid of a Default value initalization requirement :
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Working with AI MCP it seems to be struggling with the task to create a Model aka ViewModel for a CustomControl-like View (inheriting from SKCanvasElement) and I honestly those problems it was facing while creating the Methods to interact with the State and ListState thrown up challenges I am also not able to solve.
So maybe someone has some answers and recommendations for those steps for us, which includes Copilot, which did 5x query the docs MCP resources and did end up with horrible messy/workaround heavy code, which I would like to clean up to a best practice adhering result 😅
1. How to initialize a non-Generic State for a non-nullable IState which doesn't provides the Empty Operator?
Core Problems:
IState<RecordType> MyState => State.Empty(this)->StateIState<T>->Tis NOT nullable!State.SetAsyncOperator not longer availableCopilot workaround for constant "possible null return" Compiler Warnings in the later
UpdateAsyncOperatorsThe Uno.Samples/UI/MVUX Sample MessengerModel uses a static builder in the record itself, which is cleaner maybe, but if we could have a Generic State with Empty Init, its hard to understand, why we can not with a non-generic one...
So I updated to generic State to get rid of a Default value initalization requirement :
But this makes the
State.SetAsyncOperator not longer available as mentioned. seems like we have to "die one of both death's"? 😬2. How are we meant to "Reset" the State?
but nobody seems to have had in mind to allow a re-empty Operator:
All reactions