Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: simplify data view model #5

Merged
merged 4 commits into from
Mar 18, 2024
Merged

feat: simplify data view model #5

merged 4 commits into from
Mar 18, 2024

Conversation

buehler
Copy link
Collaborator

@buehler buehler commented Mar 18, 2024

BREAKING CHANGE: This removes the complex initialization
logic of the DataViewModel<T>. Instead of using the
initializeData method, now the constructor of the view model
requires some form of initial data. This requires developers to
explicitely define nullable types and allows the data field to be
initialized in all cases. To migrate, remove all initializeData calls
and provide the constructor with some default data. It is still possible
to load data asynchronously, by overwriting the initialize method and
fetching data there. One is responsible to call super.initialize in error cases.

BREAKING CHANGE: This simplifies the routable and dialog config by
removing the RouteBuilder.custom variant. Basically, to use a custom
page route builder, just use the provided property (pageRouteBuilder)
and do not set the routeBuilder property. If the page route builder is provided,
the route builder property is ignored.

@nschaer92 nschaer92 merged commit fad3176 into main Mar 18, 2024
4 checks passed
@nschaer92 nschaer92 deleted the fix/initialize-data-view branch March 18, 2024 15:53
buehler pushed a commit that referenced this pull request Mar 18, 2024
# [2.0.0](v1.2.1...v2.0.0) (2024-03-18)

### Features

* simplify data view model ([#5](#5)) ([fad3176](fad3176))

### BREAKING CHANGES

* This removes the complex initialization
logic of the `DataViewModel<T>`. Instead of using the
`initializeData` method, now the constructor of the view model
requires some form of initial data. This requires developers to
explicitely define nullable types and allows the `data` field to be
initialized in all cases. To migrate, remove all `initializeData` calls
and provide the constructor with some default data. It is still possible
to load data asynchronously, by overwriting the `initialize` method and
fetching data there. One is responsible to call `super.initialize` in
error cases.
* This simplifies the routable and dialog config by
removing the `RouteBuilder.custom` variant. Basically, to use a custom
page route builder, just use the provided property (`pageRouteBuilder`)
and do not set the `routeBuilder` property. If the page route builder is
provided,
the route builder property is ignored.
@buehler
Copy link
Collaborator Author

buehler commented Mar 18, 2024

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants