@jscutlery/rx-computed 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,8 +35,7 @@ class MyCmp {
|
|
|
35
35
|
|
|
36
36
|
### Custom Injector
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
`rxComputed` utilizes `effect()` underneath so it is **required** to be invoked within an Injection Context. However, a custom `Injector`
|
|
38
|
+
`rxComputed` utilizes `effect()` underneath so it is **required** to be invoked within an [Injection Context](https://angular.io/guide/dependency-injection-context). However, a custom `Injector`
|
|
40
39
|
can be passed in and `rxComputed` will invoke within that Injector context.
|
|
41
40
|
|
|
42
41
|
```ts
|
|
@@ -51,7 +50,7 @@ class MyCmp {
|
|
|
51
50
|
|
|
52
51
|
## Motivation
|
|
53
52
|
|
|
54
|
-
Synchronously computed signals in Angular are relatively
|
|
53
|
+
Synchronously computed signals in Angular are relatively straightforward. However, when dealing with an asynchronous source of data like an `Observable`, there is no primitive to derive a signal from it.
|
|
55
54
|
|
|
56
55
|
There are two common ways of dealing with this:
|
|
57
56
|
|
|
@@ -74,7 +73,7 @@ const recipes$ = combineLatest({
|
|
|
74
73
|
const recipes = toSignal(recipes$, []);
|
|
75
74
|
```
|
|
76
75
|
|
|
77
|
-
2. Using `
|
|
76
|
+
2. Using `effect` explicitly _(which is not the recommended way of using it, cf. https://angular.io/guide/signals#when-not-to-use-effects)_:
|
|
78
77
|
|
|
79
78
|
```typescript
|
|
80
79
|
const keywords = signal(...);
|