lib/volt/models/persistors/array_store.rb
def load_data
        # Don't load data from any queried
        if @state == :not_loaded || @state == :dirty
          # puts "Load Data at #{@model.path.inspect} - query: #{@query.inspect} on #{self.inspect}"
          change_state_to :loading

          if @query.is_a?(Proc)
            @query_computation = -> do
              stop_listening(false)

              change_state_to :loading

              new_query = @query.call

              run_query(@model, @query.call, @skip, @limit)
            end.watch!
          else
            run_query(@model, @query, @skip, @limit)
          end
        end
      end
# Called the first time data is requested from this collection
Called the first time data is requested from this collection
Called the first time data is requested from this collection
def load_data
        if @state == :not_loaded || @state == :dirty
          change_state_to :loading
          if @query.is_a?(Proc)
            @query_computation = -> do
              stop_listening(false)
              change_state_to :loading
              new_query = @query.call
              run_query(@model, @query.call, @skip, @limit)
            end.watch!
          else
            run_query(@model, @query, @skip, @limit)
          end
        end
      end
def load_data if @state == :not_loaded || @state == :dirty change_state_to :loading if @query . is_a? ( Proc ) @query_computation = -> do stop_listening ( false ) change_state_to :loading new_query = @query . call run_query ( @model , @query . call , @skip , @limit ) end . watch! else run_query ( @model , @query , @skip , @limit ) end end end
Called the first time data is requested from this collection
Called the first time data is requested from this collection
# Don't load data from any queried # puts "Load Data at #{@model.path.inspect} - query: #{@query.inspect} on #{self.inspect}"