I hereby claim:
- I am cabaalexander on github.
- I am cabaalexander (https://keybase.io/cabaalexander) on keybase.
- I have a public key ASD1l0yivNkJCaDGRsxDxHUDN9sD4LKwp7isS7axfC_T6go
To claim this, I am signing this object:
| import { Hono } from 'hono' | |
| import { jsxRenderer } from 'hono/jsx-renderer' | |
| import { Suspense } from 'hono/jsx/streaming' | |
| const app = new Hono() | |
| const Component = async () => { | |
| const res = await fetch('https://ramen-api.dev/shops/yoshimuraya') | |
| await new Promise((r) => setTimeout(r, 8000)) // <-- delay here | |
| const data = await res.json<{ shop: { name: string } }>() |
| /** | |
| * Debounce | |
| * This will create a function that can be called multiple times and only be | |
| * executed once, within a threshold you speficy | |
| * @param {function} callback Callback function to be executed | |
| * @param {number} threshold Time to wait before executing the callback | |
| * @return {function} The function that can be triggered multiple time | |
| */ | |
| function debounce(callback, threshold = 1000) { | |
| // input validation |
| /** | |
| * awaitFor | |
| * | |
| * given a selector this function promises to return a valid element when it finds it. | |
| * you can manage the timeout and the step interval if needed. | |
| * | |
| * @param selector - the selector for the element you want | |
| * @param options - configuration for the promise | |
| * @param options.intervalStep - time between checking in seconds | |
| * @param options.timeout - time in seconds to stop checking the element |
| /** | |
| * hookInto | |
| * | |
| * This will hook into a function of an object so we can check the arguments | |
| * used when it is called any time and do some calculations on those arguments. | |
| * | |
| * @param {object} targetObject Object where the function you want to target is | |
| * @param {string} functionName The name of the function you want to target | |
| * @param {function} handler The hook function that will handle the arguments | |
| * @returns {undefined} |
| // this is taken from here: | |
| // https://dev.to/rfornal/creating-a-document-fragment-5g7l | |
| let fragmentFromString = (stringHTML) => { | |
| let temp = document.createElement('template') | |
| temp.innerHTML = stringHTML | |
| return temp.content | |
| } | |
| let createNumberLabel = (content) => fragmentFromString(` | |
| <span |
I hereby claim:
To claim this, I am signing this object: