Skip to content

Commit 54796b3

Browse files
benleshCopilot
andcommitted
docs: Update thisArg pattern documentation
Ensures the code snippet will compile and work if someone copy-pastes it. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent be72ebf commit 54796b3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/rxjs/MIGRATION.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ closure or bind the callback explicitly:
8888
```ts
8989
const offset = 10;
9090
const closedOver = source[map]((value) => value + offset);
91-
const bound = source[map](project.bind(context));
91+
92+
const context = { offset: 10 };
93+
const bound = source[map](function (value) {
94+
return value + this.offset;
95+
}.bind(context));
9296
```
9397

9498
Use the exact `pipe` Symbol only when deliberate multi-step composition is

0 commit comments

Comments
 (0)