Combines multiple Bindings into a single derived binding.
Whenever any dependency emits a property change, the function is re-evaluated with all current values and the result binding updates.
Array of bindings to observe
Function that receives all current values and returns the derived value
A binding of the derived value
const label = Widget.Label({ label: Utils.merge( [battery.bind('percent'), audio.bind('volume')], (bat, vol) => `Battery: ${bat}%, Volume: ${Math.round(vol * 100)}%`, ),}); Copy
const label = Widget.Label({ label: Utils.merge( [battery.bind('percent'), audio.bind('volume')], (bat, vol) => `Battery: ${bat}%, Volume: ${Math.round(vol * 100)}%`, ),});
Combines multiple Bindings into a single derived binding.
Whenever any dependency emits a property change, the function is re-evaluated with all current values and the result binding updates.