nagare.js
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Nagare

ながれ • nagaɾe – english meaning: flow | stream | current

What is it?

Nagare is a library that helps implement "stale while revalidate" or SWR. Contrary to other solutions, this library is not bound to a single front-end framework like React, Vue or Angular. The library is built on top of RxJs and localForage which makes it very versatile and should allow it to be bloat free.

Examples

import { QueryClient } from 'nagare.js';
import { filter } from 'rxjs/operators'

const queryClient = new QueryClient();

const query$ = queryClient.query('myQueryKey', async () => 'foo');

query$
  .pipe(
    filter(response => response.isSuccess)
  )
  .subscribe(({ data }) => {
    console.log('My data: ', data) // My data: foo
  })

Package Sidebar

Install

npm i nagare.js

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

4.72 MB

Total Files

20

Last publish

Collaborators

  • cmseguin