/** * Examples for rematch commmon */ import { connect } from 'react-redux' import type { Dispatch, RootState } from '@/store' const mapState = (state: RootState) => { return { count: state.count, } } const mapDispatch = ({ count }: Dispatch) => { return { increment: () => count.increment(1), incrementAsync: () => count.incrementAsync(1), } } type CountProps = Partial & ReturnType> const Count = (props: CountProps) => (
The count
{props.count}
) export default connect(mapState, mapDispatch)(Count)