You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I'm not wrong, @marcvelmer idea is to rewrite some of the function arguments to be objects, but also ensuring the defaults are properly handled (not like in the triggering commented code).
Edit: also with this issue, it would be awesome to have all the function parameters types defined, so developers can import them later, rather than redefining the type entirely like it happens now.
Motivation
Some arguments would be better grouped in a single object, but their defaults management would be a bit different, since you have to merge that object with a defaults, rather than using defaults in the argument.
Proposal
To review every method, convert to object those params that make sense to be objects, and ensuring the defaults are properly handled.
Components affected
Mainly client.ts
The text was updated successfully, but these errors were encountered:
Also, for this feature, I think it's important to create all the types of all the arguments required by functions. So when developers use a function like createAccount, they do not need to redefine the type of the args passed (extracted from ui-components):
/** * Creates an account. * * @returns {Promise<AccountData>} */// having the type defined, this would not be requiredconstcreateAccount=(options: {account: AccountfaucetPackage?: stringsignedSikPayload?: stringpassword?: string})=>{if(state.loading.account)returnactions.fetchAccount()returnstate.client.createAccount(options).then(actions.setAccount).catch(actions.errorAccount)}
Trying to not define a type right now is not an option (and is less option to use any...):
Describe the feature
This is a followup of https://github.com/vocdoni/vocdoni-sdk/pull/226/files#r1277794806. It's created as an enhancement because it's not an issue right now (it will be an issue after anonymous is merged, but only for some methods).
If I'm not wrong, @marcvelmer idea is to rewrite some of the function arguments to be objects, but also ensuring the defaults are properly handled (not like in the triggering commented code).
Edit: also with this issue, it would be awesome to have all the function parameters types defined, so developers can import them later, rather than redefining the type entirely like it happens now.
Motivation
Some arguments would be better grouped in a single object, but their defaults management would be a bit different, since you have to merge that object with a defaults, rather than using defaults in the argument.
Proposal
To review every method, convert to object those params that make sense to be objects, and ensuring the defaults are properly handled.
Components affected
Mainly
client.ts
The text was updated successfully, but these errors were encountered: