-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Remove BaseStore<T>
and replace with composition of dependencies
#7002
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
e2d9726
to
a575644
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
abstract
class to simplify dependency structureBaseStore<T>
away from abstract
class to simplify dependency structure
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
a575644
to
1e3d048
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
runInAction(() => { | ||
this.preferences.set(entityId, merge(this.preferences.get(entityId), preferences)); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to "run in action" that single observable's update? or updating any map/set or single in general observable unit. Afaik runInAction
needs to optimize update something/optimize reactions/etc? and do it in single "transaction" when updates multiple observables within single function scope, e.g.
// that would make sense for me for example
runInAction(() => {
this.preferences.set(entityId, merge(this.preferences.get(entityId), preferences));
this.somethingObservableToo = "UPDATED!";
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes runInAction
is a way to specify a transaction. The reason why updating a single observable doesn't normally need to also be within an action is because we currently have enforceActions: false
as part of our mobx configuration.
...c/extensions/extension-loader/file-system-provisioner-store/file-system-provisioner-store.ts
Outdated
Show resolved
Hide resolved
packages/core/src/extensions/extensions-store/extensions-store.ts
Outdated
Show resolved
Hide resolved
@@ -246,7 +246,7 @@ export class ClusterManager { | |||
|
|||
protected onNetworkOnline = () => { | |||
this.dependencies.logger.info(`${logPrefix} network is online`); | |||
this.dependencies.store.clustersList.forEach((cluster) => { | |||
this.dependencies.store.clustersList.get().forEach((cluster) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why not? 🤪
anyway.. i don't think there is a big need to convert normal observable fields to computed values on the way (too much).
this.dependencies.store.clustersList.get().forEach((cluster) => { | |
this.dependencies.get().store.get().clustersList.get().forEach((cluster) => { |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
05191a0
to
0e52f3d
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
0e52f3d
to
af5bc6b
Compare
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
- To fix type errors Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
e44f44d
to
6e65fda
Compare
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
- Ubuntu CI seems to format arrays in snapshots differently than macOS locally Signed-off-by: Sebastian Malton <sebastian@malton.name>
BaseStore<T>
away from abstract
class to simplify dependency structureBaseStore<T>
and replace with composition of dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Live-reviewed
Signed-off-by: Sebastian Malton sebastian@malton.name