ns {tabler}R Documentation

Namespace an Id

Description

Prefixes an id with a namespace, mirroring the id-prefixing behaviour of shiny::ns() without depending on shiny or its module system.

Usage

ns(namespace, id = NULL)

Arguments

namespace Namespace prefix.
id Id to namespace. If missing, returns a function that namespaces any id it is given (as shiny::ns() does).

Value

If id is given, a namespaced id (character string). Otherwise, a function that namespaces any id passed to it.

Examples

my_ns <- ns("mymodule")
my_ns("button") # "mymodule-button"
ns("mymodule", "button") # "mymodule-button"

Loading...