Skip to content

Commit bd49199

Browse files
committed
Merge pull request #9 from sectore/ts1.6
Support of TypeScript 1.6
2 parents 96a06e8 + dfaa49e commit bd49199

File tree

3 files changed

+47
-33
lines changed

3 files changed

+47
-33
lines changed

examples/counter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"node-libs-browser": "^0.5.2",
4343
"react-hot-loader": "^1.2.7",
4444
"tsd": "^0.6.4",
45-
"typescript": "git://github.com/Microsoft/TypeScript.git#release-1.5",
45+
"typescript": "^1.6.2",
4646
"typescript-simple-loader": "^0.2.0",
4747
"webpack": "^1.9.11",
4848
"webpack-dev-server": "^1.9.0"
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../actions/CounterActions';
22

3-
export default (state:number, action:any) => {
4-
// to avoid tsc error "A required parameter cannot follow an optional
5-
// parameter. (1016)" set default value of state here
6-
state = (state || 0);
7-
3+
export default (state:number = 0, action:any) => {
84
switch (action.type) {
9-
case INCREMENT_COUNTER:
10-
return state + 1;
11-
case DECREMENT_COUNTER:
12-
return state - 1;
13-
default:
14-
return state;
5+
case INCREMENT_COUNTER:
6+
return state + 1;
7+
case DECREMENT_COUNTER:
8+
return state - 1;
9+
default:
10+
return state;
1511
}
1612
}

examples/counter/tsconfig.json

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
11
{
2-
"version": "1.5.0",
3-
"compilerOptions": {
4-
"target": "es5",
5-
"module": "commonjs",
6-
"declaration": false,
7-
"noImplicitAny": false,
8-
"removeComments": true,
9-
"noLib": false,
10-
"emitDecoratorMetadata": true,
11-
"experimentalDecorators": true,
12-
"sourceMap": true,
13-
"listFiles": true,
14-
"outDir": "dist"
15-
},
16-
"files": [
17-
"./node_modules/typescript/bin/lib.dom.d.ts",
18-
"./typings/_custom/custom.d.ts",
19-
"./typings/tsd.d.ts",
20-
"./containers/App.ts",
21-
"./bootstrap.ts"
22-
]
2+
"version": "1.6.2",
3+
"compilerOptions": {
4+
"target": "es5",
5+
"module": "commonjs",
6+
"declaration": false,
7+
"noImplicitAny": false,
8+
"removeComments": true,
9+
"noLib": false,
10+
"emitDecoratorMetadata": true,
11+
"experimentalDecorators": true,
12+
"sourceMap": true,
13+
"listFiles": true,
14+
"moduleResolution": "classic",
15+
"outDir": "dist"
16+
},
17+
"filesGlob": [
18+
"./**/*.ts",
19+
"!./node_modules/**/*.ts"
20+
],
21+
"files": [
22+
"./actions/CounterActions.ts",
23+
"./components/Counter.ts",
24+
"./components/hello.ts",
25+
"./containers/App.ts",
26+
"./index.ts",
27+
"./reducers/counter.ts",
28+
"./reducers/index.ts",
29+
"./store/configureStore.ts",
30+
"./typings/_custom/browser.d.ts",
31+
"./typings/_custom/custom.d.ts",
32+
"./typings/_custom/ng2.d.ts",
33+
"./typings/_custom/webpack.d.ts",
34+
"./typings/angular2/angular2.d.ts",
35+
"./typings/es6-promise/es6-promise.d.ts",
36+
"./typings/redux/redux.d.ts",
37+
"./typings/rx/rx-lite.d.ts",
38+
"./typings/rx/rx.d.ts",
39+
"./typings/tsd.d.ts"
40+
]
2341
}

0 commit comments

Comments
 (0)