react-redux-pure
v0.1.8
Published
```sh yarn add react-redux-pure ```
Downloads
2
Readme
react-redux-pure
Installation
yarn add react-redux-pure
Example
import * as React from 'react';
import { PureConnect } from 'react-redux-pure';
import { LOGOUT } from './actions';
import { username } from './selectors';
const HelloUser = PureConnect<{ page: string }>(`HelloUser` /* used for React's displayName */)(
(state) => ({
username: username(state)
}),
(dispatch) => ({
logout: () => dispatch(LOGOUT())
}),
({ page, username, logout}) => (
<div>
<p>Hello {username}, welcome to the {page}!</p>
<button type="button" onClick={logout}>Logout</button>
</div>
)
);
const Home = () => (
<div>
<HelloUser page="homepage" />
</div>
);