0.1.8 • Published 5 years ago

react-redux-pure v0.1.8

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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>
);
0.1.8

5 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago