lib/volt/models/persistors/array_store.rb
# 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)
        raise "then must pass a block" unless block
        promise = Promise.new
        promise = promise.then(&block)
        if @state == :loaded
          promise.resolve(@model)
        else
          @fetch_promises ||= []
          @fetch_promises << promise
          load_data
        end
        promise
      end
def then ( & block ) raise "then must pass a block" unless block promise = Promise . new promise = promise . then ( & block ) if @state == :loaded promise . resolve ( @model ) else @fetch_promises ||= [ ] @fetch_promises << promise load_data end 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