main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createActionProxy", {
enumerable: true,
get: function() {
return createActionProxy;
}
});
const SERVER_REFERENCE_TAG = Symbol.for("react.server.reference");
function createActionProxy(id, bound, action, originalAction) {
function bindImpl(_, ...boundArgs) {
const currentAction = this;
const newAction = async function(...args) {
if (originalAction) {
return originalAction(newAction.$$bound.concat(args));
} else {
// In this case we're calling the user-defined action directly.
return currentAction(...newAction.$$bound, ...args);
}
};
for (const key of [
"$$typeof",
"$$id",
"$$FORM_ACTION"
]){
// @ts-ignore
newAction[key] = currentAction[key];
}
// Rebind args
newAction.$$bound = (currentAction.$$bound || []).concat(boundArgs);
// Assign bind method
newAction.bind = bindImpl.bind(newAction);
return newAction;
}
Object.defineProperties(action, {
$$typeof: {
value: SERVER_REFERENCE_TAG
},
$$id: {
value: id
},
$$bound: {
value: bound
},
bind: {
value: bindImpl
}
});
}
//# sourceMappingURL=action-proxy.js.map