Skip to content

Commit

Permalink
refactor: remove optional chain syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
geekact committed Dec 19, 2022
1 parent eb608c9 commit 9f6d742
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/middleware/modelInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const modelInterceptor: Middleware<{}, Record<string, object>> =
return action.consumer(draft, action);
});

action.actionInActionGuard?.();
action.actionInActionGuard && action.actionInActionGuard();

if (deepEqual(prev, next)) return action;

Expand Down
4 changes: 2 additions & 2 deletions src/store/modelStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export class ModelStore<T = Record<string, any>> extends StoreBasic<T> {
onInitialized(maybeSync?: () => void): Promise<void> {
return new Promise((resolve) => {
if (this._isReady) {
maybeSync?.();
maybeSync && maybeSync();
resolve();
} else {
this.topic.subscribeOnce('ready', () => {
maybeSync?.();
maybeSync && maybeSync();
resolve();
});
}
Expand Down

0 comments on commit 9f6d742

Please sign in to comment.