Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1774

Merge tuples types

$
0
0

To clarify, my point was simply that, putting that JS function (or something like it) in a file, you could then bind to it for all of your combine functions without having to do the runtime busywork in rescript:

@module("my-js-module")
external combine2 = (
  ReactFirehooks.Firestore.queryResult<'a>,
  ReactFirehooks.Firestore.queryResult<'b>,
) => internalQueryResult<('a, 'b)> = "combineImpl"
...
@module("my-js-module")
external combine8 = (
  ReactFirehooks.Firestore.queryResult<'a>,
  ReactFirehooks.Firestore.queryResult<'b>,
  ReactFirehooks.Firestore.queryResult<'c>,
  ReactFirehooks.Firestore.queryResult<'d>,
  ReactFirehooks.Firestore.queryResult<'e>,
  ReactFirehooks.Firestore.queryResult<'f>,
  ReactFirehooks.Firestore.queryResult<'g>,
  ReactFirehooks.Firestore.queryResult<'h>,
) => internalQueryResult<('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h)> = "combineImpl"

@module("my-js-module") @variadic
external combineN = 
  array<ReactFirehooks.Firestore.queryResult<'a>> 
  => internalQueryResult<array<'a>> = "combineImpl"

Viewing all articles
Browse latest Browse all 1774

Trending Articles