Skip to content

Instantly share code, notes, and snippets.

@rstacruz
rstacruz / _redux.ex
Last active January 18, 2018 11:22
Redux.ex (elixir)
defmodule Redux do
@moduledoc """
Like redux.js, but more elixir-like
store = create_store fn state, action -> ... end
store |> get_state()
store |> dispatch(%{ type: "publish" })
"""
defstruct reducer: nil, state: nil