Skip to content

Commit

Permalink
test(settings): fix failing test because of settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixeladed committed Oct 20, 2020
1 parent 2dbb3e2 commit 983d8af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { getInitialState } from './state';
import { AsyncAdapterOptions } from './types';
import { setSettings } from './settings';

const createAsyncAdapter = (options: Partial<AsyncAdapterOptions>) => {
setSettings(options);
const createAsyncAdapter = (options?: Partial<AsyncAdapterOptions>) => {
if (options) setSettings(options);
return {
...reducers,
getSelectors: () => selectors,
Expand Down
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export const getSettings = () => Object.freeze(settings);
export const setSettings = (newSettings: Partial<AsyncAdapterOptions>) => {
for (const property in newSettings) {
const key = property as keyof AsyncAdapterOptions;
settings[key] = newSettings[key];
settings[key] = newSettings[key]!;
}
};

0 comments on commit 983d8af

Please sign in to comment.