Skip to content

paca94/FnFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FnFlow

TODO: Add description

  • remove try-catch in loop function

Installation

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

def deps do
  [
    {:fnflow, "~> 0.2.0"}
  ]
end

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

Example

def get_user_name(user_idx) do
  FnFlow.run(
    [
      FnFlow.df(fn _state -> AnyModel.get_by_idx(user_idx) end),
      FnFlow.af(fn state ->
        {:ok, user_info} = state.result
        {:ok, user_info.name}
      end
      )
    ]
  )
end

> get_user_name(1)
{:ok, "user_name"}

About

elixir function compose library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages