Skip to content

manvalls/swrize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swrize

SWR for functions

import swrize from "swrize";

const myFunc = swrize(
  async (foo) => {
    const res = await fetch(`https://example.com/${foo}`);
    return res.json();
  },
  {
    staleWhileRevalidate: 3600 * 24 * 7,
    maxAge: 3600,
  }
);

About

SWR for functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published