fix(lint): Apply Observable bindings to new Models
This commit is contained in:
committed by
mrugesh mohapatra
parent
22cd308fd4
commit
f3207fa902
@ -1,5 +1,9 @@
|
|||||||
'use strict';
|
import { Observable } from 'rx';
|
||||||
|
|
||||||
module.exports = function(Article) {
|
module.exports = function(Article) {
|
||||||
|
Article.on('dataSourceAttached', () => {
|
||||||
|
Article.findOne$ = Observable.fromNodeCallback(Article.findOne, Article);
|
||||||
|
Article.findById$ = Observable.fromNodeCallback(Article.findById, Article);
|
||||||
|
Article.find$ = Observable.fromNodeCallback(Article.find, Article);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
'use strict';
|
import { Observable } from 'rx';
|
||||||
|
|
||||||
module.exports = function(Popularity) {
|
module.exports = function(Popularity) {
|
||||||
|
Popularity.on('dataSourceAttached', () => {
|
||||||
|
Popularity.findOne$ = Observable.fromNodeCallback(
|
||||||
|
Popularity.findOne,
|
||||||
|
Popularity
|
||||||
|
);
|
||||||
|
Popularity.findById$ = Observable.fromNodeCallback(
|
||||||
|
Popularity.findById,
|
||||||
|
Popularity
|
||||||
|
);
|
||||||
|
Popularity.find$ = Observable.fromNodeCallback(Popularity.find, Popularity);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user