#How to use GenStateMachine in Elixir?

7 messages · Page 1 of 1 (latest)

green valley
#
defmodule TestStateMachine do
  use GenStateMachine, callback_mode: :state_functions
end

however I'm getting the following error here:

error: module GenStateMachine is not loaded and could not be found

I'm following this page: https://hexdocs.pm/gen_state_machine/GenStateMachine.html

Do I need some kind of import?

worn patrol
#

Have you installed that package?

meager thorn
#

^ and make sure you have :gen_state_machine in your applications

worn patrol
meager thorn
#

do all libs with a application mod get started by default?

worn patrol
#

No, if you do not have :applications field in your application/0 callback in mix.exs, then it will be automatically populated from your deps that aren't marked as runtime: false. For extra applications that aren't managed via Mix deps, you should use :extra_applications key