Skip to content

axelson/defconst

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Helper macros for defining constant values in modules

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%