/defconst

Helper macros for defining constant values in modules

Primary LanguageElixir

defconstant

Helper macros for defining constants in Elixir code

Installation

def deps do
  [
    {:defconstant, "~> 0.1.0"}
  ]
end

Usage

This library provides 2 macros:

  • defconst - provided body will be evaluated at compile time
  • defonce - provided body will be evaluated at runtime, but only once. After that it will be cached and served from cache.

Both helper macros allows defining only 0-ary functions (functions that take no arguments).

License

MIT