Learn R Programming

ambiorix (version 2.1.0)

as_cookie_preprocessor: Define a Cookie Preprocessor

Description

Identifies a function as a cookie preprocessor.

Usage

as_cookie_preprocessor(fn)

Arguments

fn

A function that accepts the same arguments as the cookie method of the Response class (name, value, ...), and returns a modified value.

Examples

Run this code
# NOT RUN {
func <- \(name, value, ...) {
 sprintf("prefix.%s", value)
}

prep <- as_cookie_preprocessor(func)

app <- Ambiorix$new()
app$use(prep)

# }

Run the code above in your browser using DataLab