Hello!
If you haven’t already, I think this blog post is a good introduction to the concept, and general problem space: pzuraq | blog | Introducing @use
What is the fundamental concept of a “Resource” intended to represent?
Different people may interpret the purpose / responsibility / etc differently, but to me a “Resource” is a Re-usable collection of state. That state could contain async data information, such as the examples you’ve seen. Or, they could contain, for example, “selection data”:
@tracked initiallySelected = [ ... ];
mySelection = selection(this, () => [initiallySelected]);
// provides:
// selection.select(item)
// selection.isSelected(item)
// selected.isAllSelected
// selected.isExcluded(item)
// selected.state // ALL, NONE, SOME, ALL_EXCLUDING
// etc
(useful for tables, multi-checkbox UIs, etc)
When looking at that, if you squint hard enough, it might look like this pattern:
@tracked initiallySelected = [ ... ];
@cached
get mySelection() {
let instance = new Selection(this.initialSelected);
setOwner(instance, getOwner(this));
return instance;
}
and that’s it. in a nutshell… for JS use.
But the underlying implementation of all the Resource implementations out there uses invokeHelper
as well as Helper Managers. This for extra flexibility in choosing where/how you want to use a Resource.
For example, the selection above, as a resource (if exported at app/helpers/selection
, could be used in a template like this:
{{#let (selection @initialSelected) as |mySelection|}}
{{mySelection.state}}
{{/let}}
This is useful for template-only UIs – which have a huge advantage of using data/state in a backing class: template-only UIs scope responsibility via hierarchy. 
Some example implementations of Resources out in open-source atm:
- Remote Data + non-async behavior when needed
- Hyper specific data-structures for optimizing specific use cases:
Is a Resource intended to be passed around or just interacted with in its invoking component?
Resources and concurrency tasks are equivalently tied to the lifecycle of the object they are created on. So if passing concurrency tasks around is your JAM, than passing resources around can be as well. I think this makes a lot of sense for utility-style resources (like the selection example) – as the resources could help prevent / abstract away prop drilling.
Hope this helps!