You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/features/featuresDeepDive/events/observables.md
+38
Original file line number
Diff line number
Diff line change
@@ -302,3 +302,41 @@ scene.onPointerUp = () => {
302
302
advancedTimer.stop();
303
303
}
304
304
```
305
+
306
+
## Usage with RxJS
307
+
308
+
[RxJS](https://rxjs.dev/) is a common library for handling Observables which are compliant with the [current ECMAScript Observable proposal](https://github.com/tc39/proposal-observable#ecmascript-observable). It provides a wide range of operators, allowing for advanced execution patterns.
309
+
310
+
The following (TypeScript) code can be used to convert a Babylon Observable into its RxJS equivalent:
311
+
312
+
```typescript
313
+
/**
314
+
* Wraps a Babylon Observable into an rxjs Observable
315
+
*
316
+
* @parambjsObservable The Babylon Observable you want to observe
317
+
* @example
318
+
* ```
319
+
* import { Engine, Scene, AbstractMesh } from '@babylonjs/core'
320
+
*
321
+
* const canvas = document.getElementById('canvas') as HTMLCanvasElement
0 commit comments