Skip to content

Commit 30c2e28

Browse files
committed
PR feedback
1 parent 84fd2b8 commit 30c2e28

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

packages/loot-core/src/platform/client/fetch/index.browser.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,9 @@ export const init: T.Init = async function (worker) {
147147
};
148148

149149
export const send: T.Send = function (
150-
name,
151-
args,
152-
{ catchErrors = false } = {},
153-
) {
150+
...params: Parameters<T.Send>
151+
): ReturnType<T.Send> {
152+
const [name, args, { catchErrors = false } = {}] = params;
154153
return new Promise((resolve, reject) => {
155154
const id = uuidv4();
156155

@@ -167,8 +166,7 @@ export const send: T.Send = function (
167166
} else {
168167
globalWorker.postMessage(message);
169168
}
170-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
171-
}) as any;
169+
});
172170
};
173171

174172
export const sendCatch: T.SendCatch = function (name, args) {

packages/loot-core/src/platform/client/fetch/index.web.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ export const init: T.Init = async function () {
7878
return new Promise(connectSocket);
7979
};
8080

81-
export const send = function (name, args, { catchErrors = false } = {}) {
81+
export const send: T.Send = function (
82+
...params: Parameters<T.Send>
83+
): ReturnType<T.Send> {
84+
const [name, args, { catchErrors = false } = {}] = params;
8285
return new Promise((resolve, reject) => {
8386
const id = uuidv4();
8487
replyHandlers.set(id, { resolve, reject });
@@ -103,7 +106,7 @@ export const send = function (name, args, { catchErrors = false } = {}) {
103106
});
104107
};
105108

106-
export const sendCatch = function (name, args) {
109+
export const sendCatch: T.SendCatch = function (name, args) {
107110
return send(name, args, { catchErrors: true });
108111
};
109112

0 commit comments

Comments
 (0)