Skip to content

DeltaHook

type DeltaHook = (delta, topic) => Decision<ChangeDraft>;

The type of the functions that shouldInsert, shouldModify, shouldMove and shouldDelete accept. The app calls the function once for each delta of a change that matches the topics of the hook, and passes it the delta and its topic. A delta is one modification, for example “this row was deleted”.

The function returns a Decision: allow(), veto(code, message), amend(draft) or defer(promise, reason).

Parameter Type
delta Delta
topic string

Decision<ChangeDraft>