when<S> method
S
when<S>({})
override
call one of the given callback functions depending on the type of this object.
@param insert callback function to be called if this object is of type NodeInsert @param remove callback function to be called if this object is of type NodeRemove @param add callback function to be called if this object is of type NodeAdd
Implementation
@override
S when<S>({
required S Function(INode data, int pos) insert,
S Function(INode data, int? pos)? remove,
S Function(INode data)? add,
S Function(INode update)? update,
}) {
return insert(data, position);
}