Module: Volt::Persistors::StoreState

Included in:
ArrayStore, ModelStore
Defined in:
lib/volt/models/persistors/store_state.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#loaded(initial_state = nil) ⇒ Object

Called when a collection loads



6
7
8
9
10
11
12
# 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