-
Notifications
You must be signed in to change notification settings - Fork 117
/
index.js
33 lines (29 loc) · 880 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* Descriptors are different ways of expressing a data set. Racer comes bundled
* with 2 descriptor types:
*
* 1. Path Patterns
*
* model.subscribe('users.*.name', callback);
*
* 2. Queries
*
* var query = model.query('users').withName('Brian');
* model.fetch(query, callback);
*
* Descriptors allow you to create expressive DSLs to write addresses to data.
* You then pass the concrete descriptor(s) to fetch, subscribe, or snapshot.
*/
var mixinModel = require('./descriptor.Model')
, mixinStore = __dirname + '/descriptor.Store'
, patternPlugin = require('./pattern')
, queryPlugin = require('./query')
;
exports = module.exports = plugin;
exports.useWith = {server: true, browser: true};
exports.decorate = 'racer';
function plugin (racer) {
racer.mixin(mixinModel, mixinStore);
racer.use(patternPlugin);
racer.use(queryPlugin);
}