[Feature] stack based plain-function-helper access to the owner during rendering
Open
Needs Research
Needs RFC
Needs Submitter Response
- Dominant language
- TypeScript
- Stars
- 22.6k
- Forks
- 4.2k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 15
Description
I don't want to write an RFC for this right now, as I think it'd be better to prototype the code first
during render, we always know the owner.
so when when invoking a helper (plain function or not), we could do:
```js
// internal psuedo-code
setActiveOwner() // global
invokeHelper(usersHelper) // the users helper
clearActiveOwner(); // global
```
and then
```js
function usersHelper() {
let owner = getOwner();
assert('..', owner);
let service = owner.lookup('...');
return service.format(....)
}
```
this way folks don't need to use class-based helpers or resources to get access to the owner.
Contributor guide
Assessment
This issue has not been assessed yet.