ReSift

ReSift

  • Docs
  • API
  • Help
  • GitHub

›API

Introduction

  • What is ReSift?
  • Installation

Tutorial

  • ReSift Rentals

Main Concepts

  • What's a fetch?
  • How to define a fetch
  • Making state consistent
  • Making sense of statuses
  • What are data services?
  • Error handling
  • Custom hooks

Examples

  • ReSift Notes (CRUD)
  • Infinite scroll
  • Custom hooks and React Router

Guides

  • ReSift vs Apollo and Relay
  • HTTP proxies
  • Usage with TypeScript
  • Usage with Redux
  • Usage with classes

API

  • About these docs
  • useStatus
  • useError
  • useDispatch
  • useData
  • useClearFetch
  • isUnknown
  • isNormal
  • isLoading
  • isError
  • defineFetch
  • dataServiceReducer
  • createStoreKey
  • createHttpService
  • createHttpProxy
  • createDataService
  • createActionType
  • combineStatuses
  • ResiftProvider
  • Guard
  • CanceledError
  • UNKNOWN
  • NORMAL
  • LOADING
  • ERROR
Edit

createHttpProxy API

These docs are auto-generated from typings files (*.d.ts).

createHttpProxy

Creates an HTTP Proxy that can be used to intercept requests made with the HTTP service.

See this doc for more info.

function createHttpProxy(
  // This takes in the same parameters as `matchPath` or `` from `react-router`
  // [See `react-router`'s docs for more info.](https://reacttraining.com/react-router/web/api/matchPath)
  matchParams: string | string[] | MatchParams,

  // ReSift will provide `params` below. Destructure it to get the desired props.
  handler: (params: HttpProxyParams) => any
): HttpProxy;

HttpProxyParams

The params to the handler of an HTTP proxy.

NameDescriptionType
matchThe match object from matchPath from react-router.

See react-router's docs for more info.
Match
httpThe http function that createHttpService creates. This is the same http you destructure
to use the HTTP service.
(requestParams: HttpParams) => Promise
requestParamsThe parameters passed into the http call from the original request.HttpParams
headersAny headers that were passed through from getHeaders in createHttpServiceany
prefixThe prefix passed into createHttpService.string
onCancelThe cancellation mechanism from the HTTP service.(subscriber: () => void) => void
getCanceledThe cancellation mechanism from the HTTP service.() => boolean
← createHttpServicecreateDataService →
  • createHttpProxy
  • HttpProxyParams
ReSift
Docs
What is ReSift?What's a fetch?API
Community
Ask a questionOpen an issue@ meLeave feedback
More
StarBuild StatusCoverage Status
Copyright © 2021 Sift
www.justsift.com