Allow the polling controllers to accept generic input when starting a poll.
Today they accept:
networkClientId: NetworkClientId,
options: Json
But controllers may want unique polling loops over other data.
This PR allows controllers to use any serializable type as their polling input. Controllers pass their input type as a generic argument to the base class, making it more type safe than then previous options: Json.
An example of how this would be used in the future, is how CurrencyRateController only needs a polling loop for each unique native currency. So it would define:
type CurrencyRatePollingInput = {
nativeCurrency: string;
};
Proposal
Allow the polling controllers to accept generic input when starting a poll.
Today they accept:
But controllers may want unique polling loops over other data.
This PR allows controllers to use any serializable type as their polling input. Controllers pass their input type as a generic argument to the base class, making it more type safe than then previous
options: Json
.An example of how this would be used in the future, is how
CurrencyRateController
only needs a polling loop for each unique native currency. So it would define:And you would initiate polling with: