wolfgangGoedel / observe-on-scope

RxJS operator for angular.js integration
MIT License
5 stars 0 forks source link

Question: Why not using $scope.$evalAsync() ? #1

Open davinkevin opened 7 years ago

davinkevin commented 7 years ago

Hi,

I've seen your presentation at ngEurope last week and I was interested by what you presented because we introduce last year the same subject in our project. RxJS in AngularJS.

And, after reading your code, I saw the $scope.safeApply, but I'm wondering why you're not using $scope.$evalAsync() to do the job for you ?

BTW, I'm really interested by a version of ObserveOnScope for RxJS v4 we can import as a npm package in our project...

Thanks

wolfgangGoedel commented 7 years ago

Hi,

sorry, I couldn't answer yesterday. You are right about evalAsync, it would work but it changes the semantics of observables. Subscription should be synchronous by default. You can change this with schedulers if you need to and I wanted to stay as transparent as possible. In your tests, it if more convenient when using synchronous subscriptions too.

I have planned to add an implementation for RxJS4 and to publish both versions on NPM. I hope I can find time this weekend. License is missing too, will be MIT so you can use the code without restrictions.

W.

On 2 Nov 2016, at 12:29, Davin Kevin notifications@github.com wrote:

Hi,

I've seen your presentation at ngEurope last week and I was interested by what you presented because we introduce last year the same subject in our project. RxJS in AngularJS.

And, after reading your code, I saw the $scope.safeApply, but I'm wondering why you're not using $scope.$evalAsync() to do the job for you ?

BTW, I'm really interested by a version of ObserveOnScope for RxJS v4 we can import as a npm package in our project...

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

mischkl commented 7 years ago

Just wanted to say thanks for this. Saw your talk at ng-europe and it was exactly what I was looking for. Can't wait for the first official (npm package) release! :)

P.S. regarding support of RxJS 4, I guess you have seen this? https://github.com/Reactive-Extensions/rx.angular.js/

I figured you might have been inspired by that. They also offer a factory function called observeOnScope. In any case I guess there is some potentially useful source code in that project that could be reused/provide a good reference...

Cheers