View Source Omnipresence

Yet another presence checker for elixir.

installation

Installation

If available in Hex, the package can be installed by adding omnipresence to your list of dependencies in mix.exs:

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

usage

Usage

import Omnipresence

if present?(calculated_value()) do
  IO.puts("I'm present")
else
  IO.puts("I'm blank")
end

if blank?(nil) do
  IO.puts("I'm blank")
end
raw_value
|> some_function()
|> Stream.map(&Omnipresence.presence/1)
|> Stream.reject(&is_nil/1)
|> Enum.each(fn value ->
  IO.inspect(value)
end)

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/omnipresence.