Would be slightly more efficient to do `!collection` check first:

```js
if (!collection && (isRemove || (onSubmit.length === 0 && (isInsert || isUpdate)))) {
```

My mistake.