Skip to content

Commit 3488825

Browse files
committed
Fix Reducer type import
1 parent a561a0c commit 3488825

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/cycle-scripts/template/src/javascript/app.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module.exports = replacements => `${replacements.import}
22
3+
const initalState = { count: 0 }
4+
35
export function App (sources) {
46
const action$ = intent(sources.DOM)
57
const model$ = model(action$)
@@ -11,8 +13,6 @@ export function App (sources) {
1113
return sinks
1214
}
1315
14-
const initalState = { count: 0 }
15-
1616
function intent(DOM) {
1717
const add$ = DOM.select('.add').events('click')
1818
.${replacements.mapTo}(prevState => ({ ...prevState, count: prevState.count + 1 }))

packages/cycle-scripts/template/src/typescript/app.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
module.exports = replacements => `${replacements.import}
22
${replacements.typeImport}
33
import { DOMSource, VNode } from '@cycle/dom'
4-
import { Sources, Sinks, Reducer } from './interfaces'
4+
import { Sources, Sinks } from './interfaces'
55
66
export type AppState = {
7-
count : number;
7+
count : number
88
}
99
export type AppReducer = (prevState : AppState) => AppState
1010
11+
const initalState : AppState = { count: 0 }
12+
1113
export function App({ DOM } : Sources) : Sinks {
1214
const action$ : ${replacements.streamType}<AppReducer> = intent(DOM)
1315
const model$ : ${replacements.streamType}<AppState> = model(action$)
@@ -18,8 +20,6 @@ export function App({ DOM } : Sources) : Sinks {
1820
}
1921
}
2022
21-
const initalState : AppState = { count: 0 }
22-
2323
function intent(DOM : DOMSource) : ${replacements.streamType}<AppReducer> {
2424
const add$ = DOM.select('.add').events('click')
2525
.${replacements.mapTo}(prevState => ({ ...prevState, count: prevState.count + 1 }))

0 commit comments

Comments
 (0)