Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roddyyaga/bs-swr
BuckleScript bindings to SWR
https://github.com/roddyyaga/bs-swr
Last synced: 2 months ago
JSON representation
BuckleScript bindings to SWR
- Host: GitHub
- URL: https://github.com/roddyyaga/bs-swr
- Owner: roddyyaga
- License: mit
- Created: 2020-05-11T17:36:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-07T22:45:00.000Z (over 4 years ago)
- Last Synced: 2024-07-07T04:23:48.292Z (6 months ago)
- Language: OCaml
- Size: 31.3 KB
- Stars: 21
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
- awesome-luooooob - roddyyaga/bs-swr - BuckleScript bindings to SWR (OCaml)
- awesome-list - bs-swr
README
# bs-swr
BuckleScript bindings to [SWR](https://github.com/zeit/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
```reason
[@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()
};
};
```