Description Usage Arguments Value Syntactic Sugars Warning See Also Examples
Construct a module provider intended for defining modules that can be used as general purpose options and configuration containers.
1 |
... |
Named arguments used as default options. If void, no default option is set. |
A module provider which exposes an R environment. The default options arguments, if any, are used to assign the values to their corresponding names in the returned environment.
1 |
It is considered a very bad practice to define, touch, undefine, load, make, reset, or perform any other operation from within a module definition that may alterate the internal state of modulr.
%<=%
, define
, make
,
%provides%
, %requires%
,
reset
, and touch
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | reset()
"foo/config" %provides% options_provider(upper = FALSE)
"foo" %requires% list(config = "foo/config") %provides% {
function() casefold("foo", upper = config$upper)
}
foo %<=% "foo"
foo()
config %<=% "foo/config"
config$upper <- TRUE
foo()
"foo/config" %provides_options% list(upper = FALSE)
foo %<=% "foo"
foo()
touch("foo/config")
"foo/config" %provides_options% list(upper = FALSE)
foo %<=% "foo"
foo()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.