Migration to Farfetched from plain Effects
This tutorial describes how to add Farfetched to an existing application uses Effects for data fetching step by step without rewriting big parts of the codebase.
TIP
This tutorial is not a replacement for the Thorough Tutorial which is a better starting point for learning Farfetched. Furthermore, it is assumed that you have read Thorough Tutorial and know the basics of Farfetched.
Farfetched is built with continues adoption in mind, so there are straightforward steps to add it to an existing application and embrace its benefits:
- Wrap existing data fetching Effects to Queries and Mutations
- Replace existing add-ons with Farfetched operators like
retry
,cache
orconnectQuery
- Add strict Contracts to server responses
- Migrate to specific factories like
createJsonQuery
andcreateJsonMutation
- Apply declarative approach with Trigger API and
keepFresh
operator - Continue migrating application step-by-step