
neverstew
Twice called wise. 🧐
Building a better world at https://equalcare.coop.
Joined January 12, 2023
Public vals
92

neverstew
discordActivityClient
// Once setupDiscordSdk is complete, we can assert that "auth" is initialized
Script

neverstew
superchargedQueryParams
⚡ Supercharge your query params Tired of the old x=y query param limitations?
Ever wished you could say x>y or x!=y as well? Now you can! Parse query params with superchargedQueryParams and you get an array of operations for each parameter instead: import { superchargeQueryParams } from "https://esm.town/v/neverstew/superchargeQueryParams";
console.log(superchargeQueryParams(new URL("https://example.com?a=b&c>d&e!=f&e>=g")))
// {"a":[{"eq":"b"}],"c":[{"gt":"d"}],"e":[{"ne":"f"},{"gte":"g"}]}
Script

neverstew
vtApiTypes
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
Script

neverstew
viewSource
View source code Just like a right click + inspect on desktop, except available on mobile too! Just write the website after the / e.g.
https://neverstew-viewSource.web.val.run/bbc.co.uk
HTTP

neverstew
inTheBackgroundExample
inTheBackground With the addition of the "early return" feature of web handlers, you can now process short background tasks in vals. This can be really useful for occasions where an immediate response is required, with a subsequent update a few seconds later e.g. a Discord bot that calls ChatGPT needs to respond within a few seconds, which can be too fast for the AI to generate a response. We can instead reply immediately and then update that message later, inTheBackground Simply wrap something in inTheBackground and it will do just that! In this example, we log something a few seconds later than the web response is sent back.
HTTP