createActor parameters pattern
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10
- Forks
- 13
- Avg merge
- 4h 41m
- Merged PRs (30d)
- 1
Description
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 as upgradeCanister or setupCanister. Therefore, I would like to suggest, even if it's a breaking change, to modify the signature of the method as follow.
From:
public createActor<T = ActorInterface>(
interfaceFactory: IDL.InterfaceFactory,
canisterId: Principal,
): Actor<T> {
To something similar to:
public createActor<T = ActorInterface>(
{interfaceFactory, canisterId}: {
interfaceFactory: IDL.InterfaceFactory,
canisterId: Principal,
}
): Actor<T> {
i.e. pass an object as parameter
WDYT?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate createActor and compare its parameter convention with upgradeCanister and setupCanister, including their existing usages and tests if present. Confirm whether maintainers accept the breaking API change; done means the chosen signature is applied consistently and the relevant checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100