Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbbccd19

Browse files
authored
Update README.md
1 parented6d414 commitbbccd19

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

‎README.md‎

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,15 @@ type StoreState = { layout: LayoutState }
3939
const switchTheme=createAction('switchTheme')
4040

4141
// Build reducer
42-
const layoutReducer=newReducerBuilder<LayoutState>().handle(
43-
switchTheme,
44-
(state,action)=> {
42+
const layoutReducer=newReducerBuilder<LayoutState>()
43+
.handle(switchTheme, (state,action)=> {
4544
const isDark=!state.layout.isDark
4645
return {...state,isDark }
4746
},
4847
)
4948

5049
// Build store
51-
exportconst { mapStoreToProps, connected,...store }=newStoreBuilder<
52-
StoreState
53-
>()
50+
exportconst { mapStoreToProps, connected,...store }=newStoreBuilder<StoreState>()
5451
.withReducerBuildersMap({ layout:layoutReducer })
5552
.withDevTools()// enable chrome devtools
5653
.build()
@@ -70,15 +67,13 @@ const storeProps = mapStoreToProps(store => ({
7067
const 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-
<buttononClick={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+
<buttononClick={switchTheme}>Switch theme</button>
75+
</div>
76+
))
8277

8378
// Connect store
8479
const Root:React.FC=props=> (

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp