Skip to content

Commit

Permalink
feat(app-page-builder): add debounce in updateElementAction params
Browse files Browse the repository at this point in the history
update UpdateElementActionArgsType
  • Loading branch information
Ashu96 committed Nov 5, 2021
1 parent 549c3d5 commit 86b4460
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -6,7 +6,7 @@ import { UpdateElementActionArgsType } from "./types";
export const updateElementAction: EventActionCallable<UpdateElementActionArgsType> = (
state,
{ client },
{ element, history, triggerUpdateElementTree }
{ element, history, triggerUpdateElementTree, debounce, onFinish }
) => {
const actions = [];
if (history === true) {
Expand All @@ -15,7 +15,7 @@ export const updateElementAction: EventActionCallable<UpdateElementActionArgsTyp
"You cannot save revision while updating if you do not pass client arg."
);
}
actions.push(new SaveRevisionActionEvent());
actions.push(new SaveRevisionActionEvent({ debounce, onFinish }));
}
// Add "UpdateElementTreeActionEvent" to actions.
if (triggerUpdateElementTree) {
Expand Down
@@ -1,6 +1,7 @@
import { PbEditorElement } from "~/types";
import { SaveRevisionActionArgsType } from "~/editor/recoil/actions/saveRevision/types";

export type UpdateElementActionArgsType = {
export type UpdateElementActionArgsType = SaveRevisionActionArgsType & {
element: PbEditorElement;
history: boolean;
triggerUpdateElementTree?: boolean;
Expand Down

0 comments on commit 86b4460

Please sign in to comment.