Closed joshheald closed 3 hours ago
1 Warning | |
---|---|
:warning: | View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity. |
Generated by :no_entry_sign: Danger
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
App Name | WooCommerce iOS | |
Build Number | pr14482-ab3af49 | |
Version | 21.1 | |
Bundle ID | com.automattic.alpha.woocommerce | |
Commit | ab3af49d33db5a89cc146d2a923af938a5efb7da | |
App Center Build | WooCommerce - Prototype Builds #11705 |
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.
Version 21.2
has now entered code-freeze, so the milestone of this PR has been updated to 21.3
.
Part of: #14458
Description
This PR simplifies the CartViewModel, removing its dependency on the aggregate model and making it a plain class, no longer an ObservedObject.
My thinking is moving towards renaming these – they're simpler because they don't have any state, but if they don't have any state, are they really a (View)Model? Probably not. I don't have a new name yet though.
Testing information
There wasn't much change required here. The main thing to test is the items count at the top of the cart when you have items showing.
We no longer keep state in the "view model", just depend on it from the view.
I checked that it responds as expected to adding items, removing items, clearing the cart, going back after completing an order, and going back from an error state.
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: