@@ -39,18 +39,15 @@ type StoreState = { layout: LayoutState }
3939const switchTheme= createAction (' switchTheme' )
4040
4141// Build reducer
42- const layoutReducer= new ReducerBuilder <LayoutState >().handle (
43- switchTheme ,
44- (state ,action )=> {
42+ const layoutReducer= new ReducerBuilder <LayoutState >()
43+ .handle (switchTheme , (state ,action )=> {
4544const isDark= ! state .layout .isDark
4645return {... state ,isDark }
4746 },
4847)
4948
5049// Build store
51- export const { mapStoreToProps, connected,... store }= new StoreBuilder <
52- StoreState
53- > ()
50+ export const { mapStoreToProps, connected,... store }= new StoreBuilder <StoreState >()
5451 .withReducerBuildersMap ({ layout:layoutReducer })
5552 .withDevTools ()// enable chrome devtools
5653 .build ()
@@ -70,15 +67,13 @@ const storeProps = mapStoreToProps(store => ({
7067const dispatchProps= mapDispatchToProps ({switchTheme })
7168
7269// Connect component
73- const ConnectedMain= connected (
74- storeProps ,
75- dispatchProps ,
76- )(({theme ,switchTheme })=> (
77- <div >
78- <span >Current theme:{ theme } </span >
79- <button onClick = { switchTheme } >Switch theme</button >
80- </div >
81- ))
70+ const ConnectedMain= connected (storeProps ,dispatchProps )(
71+ ({theme ,switchTheme })=> (
72+ <div >
73+ <span >Current theme:{ theme } </span >
74+ <button onClick = { switchTheme } >Switch theme</button >
75+ </div >
76+ ))
8277
8378// Connect store
8479const Root: React .FC = props => (