Skip to content

sashulinator/rc-redux-api-mw-fake-response

Repository files navigation

What is it?

Simple API middleware

Usage

import { REDUX_API_MIDDLEWARE } from '@savchenko91/rc-redux-api-mw'

const SAVE_CAT = {
  START: 'CATS | SAVE | START',
  FAIL: 'CATS | SAVE | FAIL',
  SUCCESS: 'CATS | SAVE | SUCCESS',
}

const saveCat = (id, body, onSuccess) => ({
  type: REDUX_API_MIDDLEWARE,
  url: `/api/v1/cats/${id}`,
  method: 'post',
  stageActionTypes: SAVE_CAT,
  body,
  onSuccess,
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published