This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// simple express server | |
var express = require('express'); | |
var app = express(); | |
var router = express.Router(); | |
app.use(express.static('public')); | |
app.get('/', function(req, res) { | |
res.sendfile('./public/index.html'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useAsync } from './use-async.js'; | |
import { useAsyncCallback } from './use-async-callback.js'; | |
export function Cat() { | |
const { data, error, loading } = useAsync( | |
async (signal) => { | |
const cats = await fetch( | |
'https://api.thecatapi.com/v1/images/search?size=full', | |
{ signal } | |
); |