Make your AngularJS apps even more reactive, by using bacon.js FRP library to process your scope properties.
Simply require angular-bacon in your AngularJS module, and both $rootScope and Bacon objects are augmented automatically with the following functions:
This function is equivalent to
$scope.$watchAsProperty but using
$watchCollection instead of
$watch, so that changes in Array and Object values are properly detected.
Digests a bacon.js observable (stream or property) back to an AngularJS scope property. Attaches an .onValue handler to the observable, which simply $applies the property in the selected scope with the selected key.
Digests multiple bacon.js observables at once. Simple syntactic sugar, when multiple observables are involved. observables is a map with object keys representing $scope property names into which the observables are digested into.
Subscribes to scope hierarchy events as Bacon.EventStream. event is a name of the event. Created stream will contain AngularJS scope event objects, augmented with an .args property, containing a list of all additional arguments passed in the $emit call.
For examples, see here. This example somewhat mimics raimohanska's awesome bacon.js tutorials: it features a simple login validation form, where a slow backend "is-nickname-taken" check is simulated by a stream with a 5-second delay. In addition, the two selected passwords must match, and be at least five characters long before the submit button is enabled.
Use $evalAsync instead of $apply when digesting streams to scopes. This change is potentially backwards-incompatible for code that relies on synchronous digestion of streams.
Fix issue with root scope digest already in progress when digesting streams in directives.
Augment isolate scopes with angular-bacon functions.
Add package.json main module.
Fix issue with end of bus not having its scope bound correctly on scope destruction callback.
Bump bacon.js to newer version.
Add $watchCollectionAsProperty(). Requires Angular 1.2+.
End $watchAsProperty() streams and unsubscribe .digest() listeners when scope is destroyed.
Add MIT License.