From 25282be67d877dbce7523d4bf24a9cdf7297ad28 Mon Sep 17 00:00:00 2001 From: Phil Cockfield Date: Wed, 28 Feb 2024 19:49:32 +1300 Subject: [PATCH] Update README.md sample code: simplify observable subscription --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5496b3e..3cc0687 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ to keep track of directional data being sent and received, for example: ```ts function monitor(adapter: PeerjsNetworkAdapter, dispose$?: Observable) { const detach = adapter.onData((e) => console.log(`⚡️ ${e.direction}: ${e.bytes} bytes`)); - dispose$?.subscribe(() => detach()); + dispose$?.subscribe((detach); } ```