Skip to content

roddyyaga/bs-swr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bs-swr

BuckleScript bindings to SWR.

Installation

Add

"@roddynpm/bs-swr": "^0.2.5",
"swr": "^0.2.0",

as dependencies to package.json and @roddynpm/bs-swr to bsconfig.json.

Example

[@react.component]
let make = () => {
  let config = Swr.Options.make(~dedupingInterval=6000, ());
  let Swr.{data} = Swr.useSWR(~config, "key", _ => load_data());

  switch (data) {
  | Some(data) => render(data)
  | None => render_loading()
  };
};

About

BuckleScript bindings to SWR

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages