freeCodeCamp/api-server/common/models/popularity.js

16 lines
422 B
JavaScript
Raw Normal View History

import { Observable } from 'rx';
2018-07-30 19:39:43 +00:00
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);
});
2018-07-30 19:39:43 +00:00
};