fast-twitch.middlewares.flash
Complete generated reference for fast-twitch.middlewares.flash
Usage and execution boundary
Transfers one-time flash data through the session. Request loading clears the saved flash and response :flash stores the next value. Session loading/saving must surround this wrapper.
(ns application.middleware
(:require [fast-twitch.middlewares.flash :as middleware]))
(defn handler [_]
{:status 200 :headers {"content-type" "text/plain"} :body "Hello"})
(def app (middleware/wrap-flash handler))
This defines the Ring handler portion. Adapt app through routing/ft-handler or pass it to server/listen!; startup instructions and a complete walkthrough show the surrounding project.
Wrapper order and all middleware families. The function reference below preserves the upstream signatures and source links; helper functions do not all share the wrapper's arity.
Upstream function reference
Moves flash data between the session and request or response maps.
flash-request
(flash-request request)
Function.
Loads flash data from the session and clears it for the next request. Source
flash-response
(flash-response response request)
Function.
Stores outgoing flash data back into the session. Source
wrap-flash
(wrap-flash handler)
Function.
Wraps a handler with flash loading and persistence. Source