2.0.13 • Published 2 years ago

redux-api-request v2.0.13

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

2 years ago

2.0.2

2 years ago

2.0.13

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.11

2 years ago

2.0.7

2 years ago

2.0.12

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.9.4

5 years ago

1.9.3

5 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

6 years ago

1.8.0

7 years ago

1.7.0

7 years ago

1.6.0

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.9

8 years ago