-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createActor parameters pattern #46
Comments
A propos, maybe would also be interesting to add an optional identity to the parameters - e.g. this is how I had to use it:
|
My thinking here was that less than 3 paramters didn't justify an object as a parameter, but I can see how this feels inconsistent with the vast majority of public methods that have 3 or more parameters and hence have an object as a parameter. The identity parameter is a nice suggestion too. I'll take a look at both next week and report back. Thanks for the suggestion! |
I have to add that I enforce object for all parameters in my projects for maintability reason and to prevent unexpected runtime error (when no candid or library such as Zod is used), so that's probably also why I was suprised. Definitely just a suggestion. |
Suggestion
I just used
pic.createActor
for the first time and, I was suprised to notice that the pattern used to pass its parameters is different that other function such asupgradeCanister
orsetupCanister
. Therefore, I would like to suggest, even if it's a breaking change, to modify the signature of the method as follow.From:
To something similar to:
i.e. pass an object as parameter
WDYT?
The text was updated successfully, but these errors were encountered: