module Volt::Persistors::StoreState

StoreState provides method for a store to track its loading state.

Public Instance Methods

loaded(initial_state = nil) click to toggle source

Called when a collection loads

# File lib/volt/models/persistors/store_state.rb, line 6
def loaded(initial_state = nil)
  if initial_state
    @model.change_state_to(:loaded_state, initial_state)
  elsif !@loaded_state
    @model.change_state_to(:loaded_state, :not_loaded)
  end
end