3.0.1 • Published 8 years ago

falcor-lazy-model v3.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

falcor-lazy-model Build Status

Call falcor methods before a falcor model is created

Install

$ npm install --save falcor-lazy-model

Usage

var LazyModel = require('falcor-lazy-model')
var FalcorModel = require('falcor').Model

var model = LazyModel(function getModel (callback) {
  // wait until auth is done, and then...
  callback(new FalcorModel({
    //..options
  })
})

model.get(['foo', 'bar'], ['baz', 'bang'], function (error, data) {
  // methods will be queued until the model is actually loaded
})

API

LazyModel(function getModel) -> asyncModel

getModel

Required Type: function

A function which takes a callback. Call the callback with (error, falcorModel).

asyncModel

Returned from LazyModel constructor. Has methods get, set, call, invalidate, getValue.

All of these take the normal arguments, with one exception: they don't return promises, instead they accept an additional (error, data) callback at the end.

License

MIT © Andrew Joslin

3.0.1

8 years ago

3.0.0

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.8

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago