Skip to content
On this page

v0.3 Sirinat

The third release of Farfetched includes the most requested feature — operator cache. It allows to cache any Query and make user interface respond immediately to the data that is already available. Read more about it in the API reference, tutorial, and deep-dive article.

ts
import { cache, createQuery } from '@farfetched/core';

const languageQuery = createQuery({
  handler: async () => {
    const res = await fetch('/api/language');

    return res.json();
  },
});

cache(languageQuery);

It also includes a couple of minor improvements and bug fixes.

Why Sirinat?

Sirinat National Park is quite a small park at the northwest coast of Phuket Island where Farfetched was born.

Sirinat

Migration guide

retry

retry(config) overload has been deprecated in favor of retry(operation, config) to support retrying of Mutations as well as Queries. The old overload will be removed in the next release.

ts
retry(
  someQuery, 
  {
    query: someQuery, 
    times: 3,
    delay: 1000,
  }
);

Effector 22.4

This release is compatible with Effector 22.4. If you are using Effector 22.3, you should upgrade to 22.4.

Full changelog

0.3.5

@farfetched/core

Patch Changes

  • 7cc84da: Fix incorrect cache saving in cache on Query with mapData

0.3.4

@farfetched/core

Patch Changes

  • ffee151: Do not throw error on initializing stage for browser-only cache adapters in node-env

0.3.3

@farfetched/core

Patch Changes

  • 733c0dd: Fix incorrect typings of cache operator for Query with initial data

0.3.2

@farfetched/core

Patch Changes

  • 072aae1: Handle null values in Sourced fields

0.3.1

@farfetched/core

Patch Changes

  • 7498a4a: Remove dependency added by mistake — runtypes

0.3.0

@farfetched/core

Minor Changes

  • d1b5f5a: Add cache operator
  • d1b5f5a: Allow passing Time as a delay in retry
  • d1b5f5a: Add sessionStorageCache adapter
  • d1b5f5a: Add option initialData for createJsonQuery
  • d1b5f5a: Add option initialData for createQuery
  • d1b5f5a: Allow using retry with Mutation
  • d1b5f5a: Allow setting initial data for Query
  • d1b5f5a: Add inMemoryCache adapter
  • d1b5f5a: Support custom serialization for $data in Query with Effector 22.4
  • d1b5f5a: Add voidCache adapter
  • d1b5f5a: Add localStorageCache adapter
  • d1b5f5a: Add externalCache adapter

Released under the MIT License.