Drafter.Accounts.RegisterApp (drafter v0.4.0)

Copy Markdown View Source

The form a new user fills in to create an account.

Asks for a username, a password and its confirmation, creates the account in the Drafter.Accounts server given in props.accounts, and stops. The outcome is sent to props.notify (default: the loop process) as {:drafter_registration, {:ok, account}} or {:drafter_registration, :cancelled}.

Tab moves between fields, Enter submits, Escape or ctrl+c cancels. A refusal from the store is shown above the form and the fields stay filled.

Props

  • :accounts - the Drafter.Accounts server. Required.
  • :notify - the pid told the outcome. Default self() at mount.
  • :title - the heading. Default "Create an account".

Summary

Functions

keybindings()

on_timer(timer_id, state)

Callback implementation for Drafter.App.on_timer/2.

unmount(state)

Callback implementation for Drafter.App.unmount/1.