Add files

This commit is contained in:
tkqubo
2015-09-23 23:15:26 +09:00
parent 32029fcb4e
commit 6288c788f4
2 changed files with 35 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
/// <reference path="react-redux.d.ts" />
/// <reference path="../react/react.d.ts"/>
import { Component } from 'react';
import { connect } from 'react-redux';
function mapStateToProps(state: any): any {
return {
value: state.counter
};
}
let increment: Function;
function mapDispatchToProps(dispatch: any): any {
return {
onIncrement: () => dispatch(increment())
};
}
export class Counter extends Component<string, string> {
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(Counter);
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for react-redux
// Project: https://github.com/rackt/react-redux
// Definitions by: Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "react-redux" {
export function connect<T>(...functions: Function[]): (t: T) => T;
}