[](https://travis-ci.com/garywenneker/react-hookz) [ => {
const counter = store.state.counter + amount;
store.setState({ counter });
};
`
#### HOC
`javascript
import React from "react";
import ReactHookz from "react-hookz";
import * as actions from "../actions/index";
export interface GlobalState {
counter: number;
}
const initialState: GlobalState = {
counter: 1
};
const useReactHookz = ReactHookz(React, initialState, actions);
export const connect = Component => {
return props => {
let [state, actions] = useReactHookz();
let _props = { ...props, state, actions };
return ;
};
};
export default useReactHookz;
`
#### Component
`javascript
import React from "react";
import { connect } from "../store";
interface Props {
state: any;
actions: any;
}
const Counter: React.FC = props => {
const { state, actions } = props;
return (
FC Counter:
{state.counter}
);
};
export default connect(Counter);
``