1.0.5 • Published 5 years ago

redux-progress v1.0.5

Weekly downloads
5
License
ISC
Repository
github
Last release
5 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

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.29

6 years ago

0.0.28

6 years ago

0.0.27

6 years ago

0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago