@pulse-editor/react-api 0.1.1-beta.79 → 0.1.1-beta.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +14 -5
- package/dist/main.js.map +1 -1
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -5726,7 +5726,14 @@ function useActionEffect(params, deps, isExtReady = true) {
|
|
|
5726
5726
|
if (isExtReady && remoteOrigin) {
|
|
5727
5727
|
updateAction();
|
|
5728
5728
|
}
|
|
5729
|
-
}, [
|
|
5729
|
+
}, [
|
|
5730
|
+
params.actionName,
|
|
5731
|
+
imc,
|
|
5732
|
+
isExtReady,
|
|
5733
|
+
remoteOrigin,
|
|
5734
|
+
beforeAction,
|
|
5735
|
+
afterAction,
|
|
5736
|
+
]);
|
|
5730
5737
|
useEffect(() => {
|
|
5731
5738
|
setBeforeAction(() => params.beforeAction ?? (async () => { }));
|
|
5732
5739
|
setAfterAction(() => params.afterAction ?? (async () => { }));
|
|
@@ -5736,14 +5743,16 @@ function useActionEffect(params, deps, isExtReady = true) {
|
|
|
5736
5743
|
if (!handler) {
|
|
5737
5744
|
throw new Error("Action handler is not set");
|
|
5738
5745
|
}
|
|
5746
|
+
let beforeRes;
|
|
5739
5747
|
if (beforeAction) {
|
|
5740
|
-
|
|
5748
|
+
beforeRes = await beforeAction(args);
|
|
5741
5749
|
}
|
|
5742
|
-
let res = await handler(args);
|
|
5750
|
+
let res = await handler(beforeRes !== undefined ? beforeRes : args);
|
|
5751
|
+
let afterRes;
|
|
5743
5752
|
if (afterAction) {
|
|
5744
|
-
|
|
5753
|
+
afterRes = await afterAction(res);
|
|
5745
5754
|
}
|
|
5746
|
-
return res;
|
|
5755
|
+
return afterRes !== undefined ? afterRes : res;
|
|
5747
5756
|
}
|
|
5748
5757
|
function getReceiverHandlerMap(actionHandlerFunc) {
|
|
5749
5758
|
const receiverHandlerMap = new Map([
|