Skip to content

Latest commit

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Stati

Stati is a set of macros to do simple state manipulation, where state is a mixture of encapsulated maps and arrays.

Lets assume there is a variable state with the value

state=%{user: %{name: "foo",password: "bar"},something: %{else: "bar"}}

and you want to change the password to "BAR" then you would normally do

 ${state|user: %{state.user|password: "BAR"}}

which is kind of ugly and becomes even worse if you have more levels. With Stati it is done by

Stati.change(state.user.password="BAR")

Installation

If available in Hex, the package can be installed as:

  1. Add stati to your list of dependencies in mix.exs:

    def deps do [{:stati, "~> 0.0.1"}] end

  2. Ensure stati is started before your application:

    def application do [applications: [:stati]] end

About

Elixir macros to easily manipulate map/list state

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages