1.0.8 • Published 4 years ago
rxify-class v1.0.8
rxify-class
Decorates an existing class with methods supporting Rxjs. No more ugly callback functions :). In contrast to other modules you can wrap a whole class in one go, specifying the methods you want to decorate.
Install
# NPM
$ npm install rxify-class
# Yarn
$ yarn add rxify-class
Usage
Example with in-memory MongoDB:
const rxifyClass = require('rxify-class');
const MongoInMemory = rxifyClass(
require('mongo-in-memory'),
['start', 'getConnection']
);
var mongoInMemory = new MongoInMemory(8000);
mongoInMemory.start().subscribe(config => {
mongoInMemory.getConnection('test').subscribe(client => {
...
});
});
License
Unless stated otherwise all works are:
Copyright © Sebastian Landwehr info@dword-design.de
and licensed under: