Skip to content

Commit cbe8631

Browse files
committed
fix(core): CHECKOUT-2450 Mark options as optional
1 parent 9b12b96 commit cbe8631

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/create-data-store.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import createDataStore from './create-data-store';
2+
import DataStore from './data-store';
3+
4+
describe('createDataStore()', () => {
5+
it('creates data store', () => {
6+
const store = createDataStore((state) => state);
7+
8+
expect(store).toBeInstanceOf(DataStore);
9+
});
10+
});

src/create-data-store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import Reducer from './reducer';
55

66
export default function createDataStore<TState, TAction extends Action, TTransformedState = TState>(
77
reducer: Reducer<Partial<TState>, TAction> | ReducerMap<Partial<TState>, TAction>,
8-
initialState: Partial<TState>,
9-
options: DataStoreOptions<TState, TAction, TTransformedState>
8+
initialState?: Partial<TState>,
9+
options?: Partial<DataStoreOptions<TState, TAction, TTransformedState>>
1010
): DataStore<TState, TAction, TTransformedState> {
1111
if (typeof reducer === 'function') {
1212
return new DataStore(reducer, initialState, options);

0 commit comments

Comments
 (0)