Skip to content

Commit ce93dd2

Browse files
taking out duplicated function
1 parent 5feb8fd commit ce93dd2

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

packages/compass-generative-ai/src/store/atlas-optin-reducer.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import { throwIfAborted } from '@mongodb-js/compass-utils';
44
import type { AtlasAiService } from '../atlas-ai-service';
55
import type { PreferencesAccess } from 'compass-preferences-model';
66
import type { RootState } from './atlas-ai-store';
7-
8-
function isAction<A extends AnyAction>(
9-
action: AnyAction,
10-
type: A['type']
11-
): action is A {
12-
return action.type === type;
13-
}
7+
import { isAction } from './util';
148

159
type AttemptState = {
1610
id: number;

packages/compass-generative-ai/src/store/atlas-signin-reducer.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@ import type { ThunkAction } from 'redux-thunk';
33
import type { AtlasAuthService } from '@mongodb-js/atlas-service/provider';
44
import { throwIfAborted } from '@mongodb-js/compass-utils';
55
import type { RootState } from './atlas-ai-store';
6-
7-
function isAction<A extends AnyAction>(
8-
action: AnyAction,
9-
type: A['type']
10-
): action is A {
11-
return action.type === type;
12-
}
6+
import { isAction } from './util';
137

148
type AttemptState = {
159
id: number;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { AnyAction } from 'redux';
2+
3+
export function isAction<A extends AnyAction>(
4+
action: AnyAction,
5+
type: A['type']
6+
): action is A {
7+
return action.type === type;
8+
}

0 commit comments

Comments
 (0)