pub fn diff_with_functions<'a, Ns, Tag, Leaf, Att, Val, Skip, Rep>(
    old_node: &'a Node<Ns, Tag, Leaf, Att, Val>,
    new_node: &'a Node<Ns, Tag, Leaf, Att, Val>,
    key: &Att,
    skip: &Skip,
    rep: &Rep
) -> Vec<Patch<'a, Ns, Tag, Leaf, Att, Val>>
where Ns: PartialEq + Clone + Debug, Tag: PartialEq + Debug, Leaf: PartialEq + Clone + Debug, Att: PartialEq + Clone + Debug, Val: PartialEq + Clone + Debug, Skip: Fn(&'a Node<Ns, Tag, Leaf, Att, Val>, &'a Node<Ns, Tag, Leaf, Att, Val>) -> bool, Rep: Fn(&'a Node<Ns, Tag, Leaf, Att, Val>, &'a Node<Ns, Tag, Leaf, Att, Val>) -> bool,
Expand description

calculate the difference of 2 nodes if the skip function evaluates to true, then diffing of the node and all of it’s descendant will be skipped entirely and then proceed to the next node.

The Skip fn is passed to check whether the diffing of the old and new element should be skipped, and assumed no changes. This is for optimization where the developer is sure that the dom tree hasn’t change.

Rep fn stands for replace function which decides if the new element should just replace the old element without diffing