Closed phillipskevin closed 7 years ago
This could look something like:
import { observableFromConfig } from 'observable-decorators';
import kefirConfig from 'observable-decorators/config/kefir';
import Kefir from 'kefir';
const observable = observableFromConfig(kefirConfig);
class Foo {
@observable
bar = 'baz';
@observable
abc = 'xyz';
@observable
derived() {
return Kefir.merge([ bar ,abc ]);
}
}
This would use the toObservable
and fromObservable
functions from the config in the internal getter/setters so that internally it would use RxJS, but when properties are read from the class instances, they would be whatever stream the user wants (in this case Kefir).
For example Recompose: rxjs kefir
https://github.com/redux-observable/redux-observable uses a similar setup.