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

useClearFetch API

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

useClearFetch

Returns clearFetch — a function that you can call to remove the cached values in ReSift.

Example usage:

function ExampleComponent({ personId }) {
  const personFetch = makePersonFetch(personId);
  const clearFetch = useClearFetch();
  const dispatch = useDispatch();

  useEffect(() => {
    dispatch(personFetch());

    // `clearFetch` fits in well with React's `useEffect`'s clean-up phase
    // (note: you only need to clean up if you wish to remove the cached value)
    return () => clearFetch(personFetch);
  }, [personFetch]);

  return; // ...
}

useClearFetch signature:

function useClearFetch(): (fetch: FetchInstance) => any;
← useDataisUnknown →
  • useClearFetch
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