Open xgrommx opened 9 years ago
Hi @xgrommx, your project save me so much time and headache, thanks again. I know the API 2.0 changes but I want to support both branches. Do you have another suggestion to solve the issue with the dependency to Kefir?
@jensklose Sure! For example you can check Kefir.stream
or Kefit.fromBinder
like a function.
function fromWatch(watchExpression, objectEquality) {
var scope = this;
return Kefir[typeof Kefir.stream === "function" ? "stream" : "fromBinder"](function (emitter) {
function listener(newValue, oldValue) {
emitter.emit({oldValue: oldValue, newValue: newValue});
}
var unSubscribe = scope.$watch(watchExpression, listener, objectEquality);
scope.$on('$destroy', unSubscribe);
return unSubscribe;
});
}
Hello @jensklose. I was glad that you implemented kefir plugin for angular like a bower component. But in Kefir api the method
Kefir.fromBinder
was renamed toKefir.stream
. You can look on this https://github.com/xgrommx/angular-frp/blob/gh-pages/app/frp/angular-kefir.js#L68