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>( const call = <T = unknown>(
toCall: unknown, toCall: unknown,
{ parameters = [], notCallableReturn }: CallOptions = {}, { parameters = [], notCallableReturn }: CallOptions = {},
) => ): T =>
(typeof toCall === 'function' typeof toCall === 'function' ? toCall(...parameters) : notCallableReturn;
? toCall(...parameters)
: notCallableReturn) as T;
export default call; export default call;

Loading…
Cancel
Save