Closed campbellcole closed 11 months ago
The signature for the client.addSubscription function cause valid parameters to error out, and causes "valid" parameters to throw runtime errors.
client.addSubscription
Given the following subscription in the Router:
Router
router .subscription("logs", |s| { s(|_, test: ()| LogExportLayer::add_client()) });
the following TS will throw a TypeScript error:
client.addSubscription(["logs"], { ... }); // Argument of type '["logs"]' is not assignable to parameter of type '["logs", []]'.
and if the () type is replaced with, say, String: Argument of type '["logs"]' is not assignable to parameter of type '["logs", [string]]'.
()
String
Argument of type '["logs"]' is not assignable to parameter of type '["logs", [string]]'.
The fix is relatively simple and I will submit a pull request shortly.
Thanks! Should be fixed!
The signature for the
client.addSubscription
function cause valid parameters to error out, and causes "valid" parameters to throw runtime errors.Given the following subscription in the
Router
:the following TS will throw a TypeScript error:
and if the
()
type is replaced with, say,String
:Argument of type '["logs"]' is not assignable to parameter of type '["logs", [string]]'.
The fix is relatively simple and I will submit a pull request shortly.