0.2.2 • Published 7 years ago

redux-fancy v0.2.2

Weekly downloads
63
License
ISC
Repository
github
Last release
7 years ago

Redux fancy

Manage your ui state with redux.

Installation

npm install --save redux-fancy

Get started

MyCustomUiComponent.js

const MyCustomComponent = ({setState, isLoading}) =>
    <div onClick = {() => setState({isLoading: false})}>
        { isLoading &&  "I'm loading!" }
        { !isLoading &&  "I've stopped loading... :(" }
    </div>
export default MyCustomComponent;

Each component gets through props setState function that behaves similar to react setState, and all the props that were passed through initial state.

MyCustomComponent.js

import fancy from 'redux-fancy';
import MyCustomComponent from './MyCustomUiComponent';

const Component = fancy({
    name: 'FancyComponent',
    initialState: {
        isLoading: true
    }
})(MyCustomComponent);
export default Component;

In your app render component.

<Provider>
    <Component />
</Provider>

API

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

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