{"id":20409009,"url":"https://github.com/markylaredo/rxjs-playground","last_synced_at":"2025-08-15T00:36:14.394Z","repository":{"id":252051487,"uuid":"839221147","full_name":"markylaredo/rxjs-playground","owner":"markylaredo","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-08T08:29:52.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-07T05:06:46.299Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markylaredo.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-07T07:24:03.000Z","updated_at":"2024-08-08T08:29:55.000Z","dependencies_parsed_at":"2025-01-15T12:18:30.354Z","dependency_job_id":"93301376-4211-4e45-bc27-1c801d659aa3","html_url":"https://github.com/markylaredo/rxjs-playground","commit_stats":null,"previous_names":["markylaredo/rxjs-playground"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/markylaredo/rxjs-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markylaredo%2Frxjs-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markylaredo%2Frxjs-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markylaredo%2Frxjs-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markylaredo%2Frxjs-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markylaredo","download_url":"https://codeload.github.com/markylaredo/rxjs-playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markylaredo%2Frxjs-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270505913,"owners_count":24596505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T05:39:00.554Z","updated_at":"2025-08-15T00:36:14.356Z","avatar_url":"https://github.com/markylaredo.png","language":"JavaScript","readme":"List of examples for various RxJS functions, organized by filename. This list covers many of the commonly used RxJS functions but is not exhaustive.\n\n### Creation Operators\n**`fromExample.js`**\n```javascript\nimport { from } from 'rxjs';\n\nconst arraySource = from([1, 2, 3, 4, 5]);\narraySource.subscribe(val =\u003e console.log(val));\n```\n\n**`ofExample.js`**\n```javascript\nimport { of } from 'rxjs';\n\nconst source = of(1, 2, 3, 4, 5);\nsource.subscribe(val =\u003e console.log(val));\n```\n\n**`intervalExample.js`**\n```javascript\nimport { interval } from 'rxjs';\n\nconst source = interval(1000);\nsource.subscribe(val =\u003e console.log(val));\n```\n\n**`timerExample.js`**\n```javascript\nimport { timer } from 'rxjs';\n\nconst source = timer(3000, 1000);\nsource.subscribe(val =\u003e console.log(val));\n```\n\n**`fromEventExample.js`**\n```javascript\nimport { fromEvent } from 'rxjs';\n\nconst source = fromEvent(document, 'click');\nsource.subscribe(event =\u003e console.log(event));\n```\n\n### Transformation Operators\n**`mapExample.js`**\n```javascript\nimport { from } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nconst source = from([1, 2, 3, 4, 5]);\nconst example = source.pipe(map(val =\u003e val * 10));\nexample.subscribe(val =\u003e console.log(val));\n```\n\n**`filterExample.js`**\n```javascript\nimport { from } from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\nconst source = from([1, 2, 3, 4, 5]);\nconst example = source.pipe(filter(val =\u003e val % 2 === 0));\nexample.subscribe(val =\u003e console.log(val));\n```\n\n**`switchMapExample.js`**\n```javascript\nimport { fromEvent, interval } from 'rxjs';\nimport { switchMap } from 'rxjs/operators';\n\nconst source = fromEvent(document, 'click');\nconst example = source.pipe(switchMap(() =\u003e interval(1000)));\nexample.subscribe(val =\u003e console.log(val));\n```\n\n### Combination Operators\n**`mergeExample.js`**\n```javascript\nimport { merge, interval } from 'rxjs';\n\nconst first = interval(2500);\nconst second = interval(2000);\nconst example = merge(first, second);\nexample.subscribe(val =\u003e console.log(val));\n```\n\n**`concatExample.js`**\n```javascript\nimport { concat, of } from 'rxjs';\n\nconst sourceOne = of(1, 2, 3);\nconst sourceTwo = of(4, 5, 6);\nconst example = concat(sourceOne, sourceTwo);\nexample.subscribe(val =\u003e console.log(val));\n```\n\n**`combineLatestExample.js`**\n```javascript\nimport { combineLatest, interval } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nconst sourceOne = interval(1000);\nconst sourceTwo = interval(2000);\nconst example = combineLatest([sourceOne, sourceTwo]).pipe(\n  map(([val1, val2]) =\u003e {\n    return `Source One: ${val1}, Source Two: ${val2}`;\n  })\n);\nexample.subscribe(val =\u003e console.log(val));\n```\n\n### Utility Operators\n**`tapExample.js`**\n```javascript\nimport { from } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\nconst source = from([1, 2, 3, 4, 5]);\nconst example = source.pipe(tap(val =\u003e console.log(`Before map: ${val}`)));\nexample.subscribe(val =\u003e console.log(val));\n```\n\n**`delayExample.js`**\n```javascript\nimport { of } from 'rxjs';\nimport { delay } from 'rxjs/operators';\n\nconst source = of('Hello');\nconst example = source.pipe(delay(3000));\nexample.subscribe(val =\u003e console.log(val));\n```\n\n**`takeExample.js`**\n```javascript\nimport { interval } from 'rxjs';\nimport { take } from 'rxjs/operators';\n\nconst source = interval(1000);\nconst example = source.pipe(take(5));\nexample.subscribe(val =\u003e console.log(val));\n```\n\n**`catchErrorExample.js`**\n```javascript\nimport { of, throwError } from 'rxjs';\nimport { catchError } from 'rxjs/operators';\n\nconst source = throwError('This is an error!');\nconst example = source.pipe(catchError(val =\u003e of(`I caught: ${val}`)));\nexample.subscribe(val =\u003e console.log(val));\n```\n\nThis should give you a broad range of examples to get started with RxJS. Feel free to expand on this list based on your specific use cases and the functions you need.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkylaredo%2Frxjs-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkylaredo%2Frxjs-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkylaredo%2Frxjs-playground/lists"}