refactor: Loadable mixin no longer declares onMount and onRemove #1243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Loadable
mixin is currently used for 2 classes:Game
andComponent
. Its purpose is to provide the caching layer for the future returned by theonLoad()
method. Having empty methodsonMount()
/onRemove()
in that mixin does not fit its overall purpose. (Plus, in general, the purpose of any mixin is to add some additional concrete functionality into an existing class).In addition to the scope mismatch, these methods perform similar yet not quite the same function in
Game
andComponent
. Having these methods declared directly withinGame
andComponent
allows to document them more precisely, and help the user understand their functionality/purpose better.Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
.Breaking Change
Related Issues
Closes #1210