pay_day_loan v0.3.0 PayDayLoan.LoadState
Keeps track of which keys are loaded, requested, and loading
Acts as a state tracker and a queue for the loader.
You shouldn’t need to call any of these functions manually but they can be useful for debugging.
Summary
Functions
Returns all elements of the table
Returns true if any keys are in the :requested
state
Set state to :failed
Set state to :loaded
Set state to :loading
Return load state without modifying; return nil if key is not found
Return load state; set to :requested
if not loaded or loading
Set state to :requested
Return the list of requested keys
Remove a key from the load state table
Types
Load states that a key can have.
:requested
- A load has been requested. The load worker should pick this up and set the state to:loading
.:loading
- The load worker is in the process of loading this key.:loaded
- The key is loaded in cache.:failed
- The key attempted a load or refresh and failed.
Functions
Returns all elements of the table
Returns true if any keys are in the :requested
state
Set state to :failed
Set state to :loaded
loading(atom, PayDayLoan.key | [PayDayLoan.key]) :: :loading | [:loading]
Set state to :loading
Return load state without modifying; return nil if key is not found
Return load state; set to :requested
if not loaded or loading
request(atom, PayDayLoan.key | [PayDayLoan.key]) :: :requested | [:requested]
Set state to :requested
Return the list of requested keys
Remove a key from the load state table