Skip to content

Commit a0f1ae1

Browse files
authored
fix: fix typo and hasTag function (#29)
1 parent 5e59db5 commit a0f1ae1

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/core/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type {
1717
ActualData,
1818
ActualResponse,
1919
} from './types/DataSource';
20-
export type {DataManager} from './types/DataManger';
20+
export type {DataManager} from './types/DataManager';
2121
export type {DataLoaderStatus} from './types/DataLoaderStatus';
2222
export type {InvalidateRepeatOptions, InvalidateOptions} from './types/DataManagerOptions';
2323

src/core/utils/hasTag.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export const hasTag = (key: DataSourceKey, tag: DataSourceTag): boolean => {
1010
// First element — data source name
1111
// Last element — full key
1212
// Skip them for consistency
13-
return index > 0 && index < key.length - 2;
13+
return index > 0 && index < key.length - 1;
1414
};

src/react-query/ClientDataManager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ export type ClientDataManagerConfig = QueryClientConfig;
1616
export class ClientDataManager implements DataManager {
1717
readonly queryClient: QueryClient;
1818

19-
constructor(conifg: ClientDataManagerConfig = {}) {
19+
constructor(config: ClientDataManagerConfig = {}) {
2020
this.queryClient = new QueryClient({
21-
...conifg,
21+
...config,
2222
defaultOptions: {
23-
...conifg.defaultOptions,
23+
...config.defaultOptions,
2424
queries: {
2525
networkMode: 'always',
26-
...conifg.defaultOptions?.queries,
26+
...config.defaultOptions?.queries,
2727
},
2828
mutations: {
2929
networkMode: 'always',
30-
...conifg.defaultOptions?.mutations,
30+
...config.defaultOptions?.mutations,
3131
},
3232
},
3333
});

src/react/DataManagerContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const useDataManager = () => {
99

1010
if (!dataManager) {
1111
throw new Error(
12-
'DataManager is not provied by context. Use DataManagerContext.Provider to do it',
12+
'DataManager is not provided by context. Use DataManagerContext.Provider to do it',
1313
);
1414
}
1515

0 commit comments

Comments
 (0)