1.0.5 • Published 6 years ago

redux-progress v1.0.5

Weekly downloads
5
License
ISC
Repository
github
Last release
6 years ago

#redux-progress This library helps represent the state of asynchronous data into your application's state.

##Install yarn add redux-progress

or

npm install --save redux-progress

##Use

In your state definition:

import * as Progress from 'redux-progress';

type User = {
  name: string,
}

type State = {
  users: Progress.AsyncData<User[]>,
}

In your action:

import * as Progress from 'redux-progress';

const FETCH_USERS = 'FETCH_USERS';
const fetchUsers = Progress.thunk(FETCH_USERS, fetch('/users'));

In your reducer:

import * as Progress from 'redux-progress';

const usersReducer = (state = Progress.none, action) => {
  if(action.type === 'FETCH_USERS')
      return action.progress;
  return state; 
}

Use it:

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.29

7 years ago

0.0.28

7 years ago

0.0.27

7 years ago

0.0.26

7 years ago

0.0.25

7 years ago

0.0.24

7 years ago

0.0.23

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago