mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add files
This commit is contained in:
@@ -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);
|
||||
Vendored
+8
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user