Use computedFn as annotation in make(Auto)Observable
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Description
It seems that the only way now to use computedFn in model classes is
class Model {
getSomething = computedFn((params) => "return something");
constructor() {
makeAutoObservable(this, {
getSomething: false,
});
}
}
So it looks quite convenient to allow computedFn to be used as an annotation, so it becomes
class Model {
getSomething(params) {
return "return something";
}
constructor() {
makeAutoObservable(this, {
getSomething: computedFn,
});
}
}
Can also be done with bounds / not bound versions
Contributor guide
No contributing guide indexed for this repository
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
Start by tracing the makeAutoObservable annotation handling and the computedFn entry point. Compare the existing property-based usage with the requested computedFn annotation, including bound and unbound versions; done means the class-method examples work through makeAutoObservable and are covered by the relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100