lib/volt/models/persistors/array_store.rb
def then(&block)
      promise = Promise.new

      promise = promise.then(&block) if block

      if @state == :loaded
        promise.resolve(@model)
      else
        @fetch_promises ||= []
        @fetch_promises << promise

        load_data
      end

      return promise
    end
# Returns a promise that is resolved/rejected when the query is complete.  Any
# passed block will be passed to the promises then.  Then will be passed the model.
Returns a promise that is resolved/rejected when the query is complete.  Any
passed block will be passed to the promises then.  Then will be passed the model.
Returns a promise that is resolved / rejected when the query is complete . Any passed block will be passed to the promises then . Then will be passed the model .
def then(&block)
      promise = Promise.new
      promise = promise.then(&block) if block
      if @state == :loaded
        promise.resolve(@model)
      else
        @fetch_promises ||= []
        @fetch_promises << promise
        load_data
      end
      return promise
    end
def then ( & block ) promise = Promise . new promise = promise . then ( & block ) if block if @state == :loaded promise . resolve ( @model ) else @fetch_promises ||= [ ] @fetch_promises << promise load_data end return promise end
Returns a promise that is resolved/rejected when the query is complete.
Returns a promise that is resolved / rejected when the query is complete .
block