forked from ecomfe/saber-firework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModel.js
48 lines (41 loc) · 933 Bytes
/
Model.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* @file Model
* @param treelite([email protected])
*/
define(function (require) {
var inherits = require('saber-lang/inherits');
var Resolver = require('saber-promise');
var Abstract = require('./Abstract');
/**
* Model
*
* @constructor
*/
function Model(options) {
Abstract.call(this, options);
this.init();
}
inherits(Model, Abstract);
/**
* 获取数据
*
* @public
* @param {Object} query 查询条件
* @return {Promise}
*/
Model.prototype.fetch = function (query) {
return Resolver.resolved(query);
};
/**
* 重新获取数据
* 在被缓存的action被wakeup时调用
*
* @public
* @param {Object} query 查询条件
* @return {Promise}
*/
Model.prototype.refetch = function (query) {
return Resolver.resolved(query);
};
return Model;
});