Skip to content

Commit

Permalink
rename selfDependant to selfDependent (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
voliva authored Sep 22, 2023
1 parent 149f51d commit b71cef5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: selfDependant()
title: selfDependent()
---

A utility for creating observables that have circular dependencies.

```ts
function selfDependant<T>(): [Observable<T>, () => MonoTypeOperatorFunction<T>];
function selfDependent<T>(): [Observable<T>, () => MonoTypeOperatorFunction<T>]
```

#### Returns
Expand All @@ -19,11 +19,11 @@ function selfDependant<T>(): [Observable<T>, () => MonoTypeOperatorFunction<T>];
### Example

```ts
import { merge, of, Subject } from 'rxjs'
import { delay, map, share, switchMapTo, withLatestFrom } from 'rxjs/operators'
import { selfDependant } from '@react-rxjs/utils'
import { merge, of, Subject } from "rxjs"
import { delay, map, share, switchMapTo, withLatestFrom } from "rxjs/operators"
import { selfDependent } from "@react-rxjs/utils"
const [_resettableCounter$, connectResettableCounter] = selfDependant<number>()
const [_resettableCounter$, connectResettableCounter] = selfDependent<number>()
const clicks$ = new Subject()
const inc$ = clicks$.pipe(
Expand All @@ -39,4 +39,5 @@ const resettableCounter$ = merge(inc$, reset$, of(0)).pipe(
connectResettableCounter(),
)
```
[pipeable operator]: https://rxjs.dev/guide/v6/pipeable-operators

[pipeable operator]: https://rxjs.dev/guide/v6/pipeable-operators
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { bind } from "@react-rxjs/core"
import { createSignal } from "@react-rxjs/utils"

// A signal is an entry point to react-rxjs. It's equivalent to using a subject
const [textChange$, setText] = createSignal();
const [textChange$, setText] = createSignal<string>();

const [useText, text$] = bind(textChange$, "")

Expand Down
2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
"api/utils/createKeyedSignal",
"api/utils/mergeWithKey",
"api/utils/partitionByKey",
"api/utils/selfDependant",
"api/utils/selfDependent",
"api/utils/suspend",
"api/utils/suspended",
"api/utils/switchMapSuspended",
Expand Down

0 comments on commit b71cef5

Please sign in to comment.