mirror of
https://github.com/rowyio/rowy.git
synced 2026-02-24 04:01:17 +01:00
triggerType util
This commit is contained in:
@@ -32,3 +32,10 @@ export async function asyncForEach(array: any[], callback: Function) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
export const identifyTriggerType = (beforeData, afterData) =>
|
||||
Boolean(beforeData) && Boolean(afterData)
|
||||
? "update"
|
||||
: Boolean(afterData)
|
||||
? "create"
|
||||
: "delete";
|
||||
|
||||
Reference in New Issue
Block a user