@scalar/api-client
Version:
the open source API testing client
36 lines (35 loc) • 705 B
JavaScript
const i = (a, d, r) => ({
add: (e) => d.emit("operation:add:parameter", {
type: a,
payload: {
key: e.key ?? "",
value: e.value ?? "",
isDisabled: !1
},
meta: r
}),
delete: (e) => d.emit("operation:delete:parameter", {
type: a,
index: e.index,
meta: r
}),
deleteAll: () => d.emit("operation:delete-all:parameters", {
type: a,
meta: r
}),
update: (e) => d.emit(
"operation:update:parameter",
{
type: a,
index: e.index,
payload: e.payload,
meta: r
},
{
debounceKey: `update:parameter-${a}-${e.index}-${Object.keys(e.payload).join("-")}`
}
)
});
export {
i as createParameterHandlers
};