Say I have two Bacon.js properties. One is child object - maybe just his name. The other property object with the outfit he or she is wearing - pants color and shirt color.
In my case I am using Angular-Bacon to create properties from AngularJS scope variables.
How do I get a property that merges the two together? I'd expect I could do something like the following (assuming I had Lodash available):
var outfit = $scope.$watchCollectionAsProperty('outfit'); // {shirt: 'blue', pants: 'green'}
var child = $scope.$watchCollectionAsProperty('child'); // {name: 'Jimmy'}
var clothedChild = outfit.map(function(it) {
return _.merge(it, child.value());
});
This doesn't work, though.
I'm super new to RFP and am trying to use Bacon in an Angular app, but I'm having a hard time wrapping my head around it.
Any tips would be appreciated.