Topics: Access, Assignment, Transformations & Organization
- Lecture/Slides:
- Exercise:
_.get()
Credits to Mike North Sr.Staff Engineer from LinkedIn’s UI Infra team for the inspiration for the stuff below 🙏
What not to do
Compiling in lose mode:
Navigates? | declarative? | Makes GET, triggers loader | Makes POST, triggers action | No requests |
---|---|---|---|---|
navigates | declarative | <Link to=""> <Form method="get"> |
<Form method="post"> |
<Link to="#..."> |
navigates | imperative | navigate() setSearchParams() |
submit() |
navigate("#") |
stays | declarative | <fetcher.Form method="get"> |
<fetcher.Form method="post"> |
(doesn't make sense) |
stays | imperative | fetcher.load() |
fetcher.submit() |
(doesn't make sense) |
where
<html> | |
<head> | |
<title>grid</title> | |
<style> | |
body {padding: 0; margin: 0;} | |
.container { | |
display: grid; | |
grid-template-rows: 200px repeat(4, 100px); | |
grid-template-columns: repeat(4, 1fr); | |
grid-template-areas: "header header header header" |
/* Ultra lightweight Github REST Client */ | |
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
const token = 'github-token-here' | |
const githubClient = generateAPI('https://api.github.com', { | |
headers: { | |
'User-Agent': 'xyz', | |
'Authorization': `bearer ${token}` | |
} | |
}) |
import type { Server } from "node:http"; | |
export type Handler = (request: Request) => Response | Promise<Response>; | |
export type CreateServerOptions = { | |
onError?: (error: unknown) => void; | |
}; | |
export declare function createServer( | |
handler: Handler, |
Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts and experience preferred (super rare at this point).