@@ -9,8 +9,7 @@ import { wrapForPlainUsage } from './utils';
9
9
import type { InternalFunctionResourceConfig , ResourceFn , ResourceFunction } from './types' ;
10
10
11
11
/**
12
- * `resource` is an alternative API to the class-based `Resource`.
13
- * It may provide a single read-only value and provides a way to optionally cleanup.
12
+ * `resource` provides a single reactive read-only value with lifetime and may have cleanup.
14
13
*
15
14
* Arguments passed to the `resource` function:
16
15
* ```js
@@ -31,15 +30,6 @@ import type { InternalFunctionResourceConfig, ResourceFn, ResourceFunction } fro
31
30
* );
32
31
* ```
33
32
*
34
- * When would you reach for the class-based `Resource`?
35
- * - the capabilities of the function-based resource and class-based resource are identical,
36
- * with the exception that function-based resources may represent a single value, rather than
37
- * an object with properties/methods (the only option with class-based resources)
38
- *
39
- * A function-resource
40
- * - _must_ return a value.
41
- * - cannot, itself, be async - but can interact with promises and update a value
42
- *
43
33
* Example using `fetch` + `AbortController`
44
34
* ```js
45
35
* import { use, resource } from 'ember-resources';
@@ -80,7 +70,8 @@ import type { InternalFunctionResourceConfig, ResourceFn, ResourceFunction } fro
80
70
*
81
71
*
82
72
* Example using strict mode + `<template>` syntax and a template-only component:
83
- * ```jsx gjs
73
+ *
74
+ * ```js
84
75
* import { resource } from 'ember-resources';
85
76
* import { TrackedObject } from 'tracked-built-ins';
86
77
*
0 commit comments