fix(striker-ui-api): specify return type in call()

main
Tsu-ba-me 2 years ago
parent 809a7e2951
commit 0e31e31786
  1. 6
      striker-ui-api/src/lib/call.ts

@ -1,9 +1,7 @@
const call = <T = unknown>(
toCall: unknown,
{ parameters = [], notCallableReturn }: CallOptions = {},
) =>
(typeof toCall === 'function'
? toCall(...parameters)
: notCallableReturn) as T;
): T =>
typeof toCall === 'function' ? toCall(...parameters) : notCallableReturn;
export default call;

Loading…
Cancel
Save