2.0.13 • Published 3 years ago

redux-api-request v2.0.13

Weekly downloads
8
License
ISC
Repository
github
Last release
3 years ago

Redux middleware for making api requests

Installation

Install with npm or yarn:

npm install --save redux-api-request

Usage

Using redux-api-request in your application is easy:

# install middleware
import createApiRequest from 'redux-api-request'
import thunkMiddleware from 'redux-thunk'
import reducer from './reducer'

const apiRequestMiddleware = createApiRequest()

const createStoreWithMiddleware = applyMiddleware(
  thunkMiddleware,
  apiRequestMiddleware
)(createStore)

const store = createStoreWithMiddleware(reducer)

# action creator
import { API_REQUEST } from 'redux-api-request/action_types'

export const signin = (email, password) => ({
  type: API_REQUEST,
  method: 'POST',
  endpoint: '/admin/signin',
  body: { email, password },
  request: SIGNIN_REQUEST,
  success: SIGNIN_SUCCESS,
  failure: SIGNIN_FAILURE
})

View example app

Author & Credits

redux-api-request was originally written by Greg Kops and is based upon his work with Think Topography and The Cornell Cooperative Extension of Tompkins County

2.0.3

3 years ago

2.0.2

3 years ago

2.0.13

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.11

3 years ago

2.0.7

3 years ago

2.0.12

3 years ago

2.0.6

3 years ago

2.0.9

3 years ago

2.0.10

3 years ago

2.0.8

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.9.4

6 years ago

1.9.3

6 years ago

1.9.2

6 years ago

1.9.1

6 years ago

1.9.0

7 years ago

1.8.0

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.3

8 years ago

1.4.2

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.9

9 years ago