Menu

Inside KickJS Adapters — Lifecycle, Composition, and Custom Patterns
📰

Inside KickJS Adapters — Lifecycle, Composition, and Custom Patterns

DEV Community·Orinda Felix Ochieng·6 months ago
#hPpmRcRi
#kickjs#typescript#node#adapters#adapter
Reading 0:00
15s threshold

If you have written an Express app, you already know the shape of a middleware : a function that gets (req, res, next) and runs once per request. You probably also know what a plugin looks like — a side-effecting register(app) call that mutates a global at boot. KickJS gives you a third primitive sitting between those two, and most of the framework's interesting behaviour lives there: the adapter . An adapter is not per-request like middleware, and it is not a one-shot side-effect like a plugin. It is a typed object with a lifecycle , composed in order, orchestrated by the framework so your app can stand long-lived infrastructure up and tear it down deterministically.

What an adapter is

An adapter is a unit of composable infrastructure plugged into the KickJS bootstrap pipeline.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.