The @use
decorator can be used to use a Resource in javascript classes
import { resource, use } from 'ember-resources';
const Clock = resource(() => 2);
class MyClass {
@use data = Clock;
}
(new MyClass()).data === 2
Optional
descriptor: Stage1DecoratorDescriptorThe `use function can be used to use a Resource in javascript classes
Note that when using this version of use
, the value is only accessible on the current
property.
import { resource, use } from 'ember-resources';
const Clock = resource( ... );
class Demo {
time = use(this, Clock);
}
(new Demo()).data.current === 2
Optional
_: undefinedGenerated using TypeDoc
The
@use(...)
decorator can be used to use a Resource in javascript classes