This project contains a Node-RED node which detects changes in an input set of values and emits them as output - similar to Reactive's distinctUntilChanged operator or Node-RED's own RBE node. Other than those two, this node makes the changes in the given set of values visible.
This can come in handy when you are dealing with a node which generates identical output at a high frequency whereas you are only interested in actual changes in data.
git clone https://github.com/stefan-girlich/node-red-contrib-diff-set.git your $TARGET_FOLDER
cd $TARGET_FOLDER
npm install
npm test
cd $YOUR_PROJECT_FOLDER
npm link $TARGET_FOLDER
node-red-stop
node-red-start
# refresh your Node-RED browser tab
- As the node name points out, this node handles the given arrays of data as sets, meaning that changes in order are ignored. For instance, [1, 2, 3] is identical to [2, 3, 1].
- Currently, equality and differences between values in the set are determined by SameValueZero, but do not detect true value equality in complex JavaScript objects. E. g. "bar" === "bar", but {foo:"bar"} !== {foo:"bar"}
MIT License