{"id":13808998,"url":"https://github.com/kievsash/rxjs-toolbox","last_synced_at":"2026-01-17T23:59:00.674Z","repository":{"id":34911723,"uuid":"189316753","full_name":"kievsash/rxjs-toolbox","owner":"kievsash","description":"RxJS-toolbox - set of custom operators and handy factory functions for RxJS","archived":false,"fork":false,"pushed_at":"2024-02-14T08:50:47.000Z","size":2015,"stargazers_count":11,"open_issues_count":20,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T20:49:51.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kievsash.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2019-05-30T00:15:18.000Z","updated_at":"2025-03-30T12:39:32.000Z","dependencies_parsed_at":"2024-06-08T15:14:58.558Z","dependency_job_id":"b13c8d19-f7c0-451d-85a7-282792f1d3df","html_url":"https://github.com/kievsash/rxjs-toolbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kievsash%2Frxjs-toolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kievsash%2Frxjs-toolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kievsash%2Frxjs-toolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kievsash%2Frxjs-toolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kievsash","download_url":"https://codeload.github.com/kievsash/rxjs-toolbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253750671,"owners_count":21958346,"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","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-08-04T01:01:57.361Z","updated_at":"2026-01-17T23:59:00.646Z","avatar_url":"https://github.com/kievsash.png","language":"TypeScript","funding_links":[],"categories":["Table of contents"],"sub_categories":["Third Party Components"],"readme":"# RxJS-toolbox - set of custom operators and handy factory functions for RxJS\n\n*Note: updated to Angular 16.x in version 2.2.0\n\n## Installation\nInstall using NPM CLI\n```\nnpm install --save rxjs-toolbox\n```\n\n### forkJoin-transparent\nA combination operator that combines multiple sources and returns their last emitted data as well as percentage of their completion.\n\n### Usage\n\n#### forkJoinWithProgress\n```typescript\nimport { ajax } from 'rxjs/ajax';\nimport { merge } from 'rxjs';\n`import { forkJoinWithProgress } from 'rxjs-toolbox';`\nimport {tap, mergeMap, ignoreElements} from 'rxjs/operators';\n\nconst getUserDetails = userIdsList =\u003e {\n  \n  const arrayOfObservables = userIdsList.map(userId =\u003e\n    ajax('https://jsonplaceholder.typicode.com/comments/' + userId)\n  )\n  \n  return forkJoinWithProgress(arrayOfObservables)\n}\n\n\nconst result$ = getUserDetails([1, 2, 15]);\n\nresult$.pipe(\n  mergeMap(([finalResult, progress]) =\u003e merge(\n    progress.pipe(\n      tap((value) =\u003e console.log(`${value} completed`)),\n      ignoreElements()\n    ),\n    finalResult\n  ))\n).subscribe(values =\u003e console.log(values), console.warn);\n\n// Output:\n// 33.333333333333336 completed\n// 66.66666666666667 completed\n// 100 completed\n// final value:  (3) [{…}, {…}, {…}]\n```\n\n#### waitUntil\nI found an interesting #rxjs custom operator in [auth0-angular interceptor](https://github.com/auth0/auth0-angular/blob/v2.2.3/projects/auth0-angular/src/lib/auth.interceptor.ts) codebase: waitUntil\n\nIt holds until the param observable emits first value- and then switches to the source\n\n######Params:\nisLoaded$\n```typescript\nisLoaded$ // - some observable we wait for\n  ...\nof(route).pipe(\n    waitUntil(isLoaded$)\n)\n...\n```\n\n#### Helper functions\n##### timeRange\n Function to create Observable that will emit values with specified delays\n######Params:\n*range* - array of objects with special structure [{value: \u003csome value\u003e, delay: \u003cdelayInMs\u003e},...]\n\n*isRelative* - if true = next emissions is scheduled only after previous is complete (so delays are summarized).\n\nif false - all values are scheduled at once (delay values are absolute in relation to the moment of subscription)\n\n```typescript\n const range$ = timeRange([\n   {value: 15, delay: 1500}, // 1500ms\n   {value: 15, delay: 2500} // 2500ms\n ])\n\n  const range2$ = timeRange([\n   {value: 15, delay: 1500}, // 1500ms\n   {value: 15, delay: 2500} // 1500+2500\n ], true);\n\n```\n\n##### finalizeWithValue\nProvides (unlike original [finalize](https://rxjs.dev/api/operators/finalize) from RxJS) source$'s last emitted value (if any) in format {value: \u003clastValue\u003e}.\n\nIf source$ completes with noe emitted value - provides undefined.\n\nAuthor - Ben Lesh, taken [here](https://github.com/ReactiveX/rxjs/issues/4803#issuecomment-496711335)\n\n```typescript\n\nfrom([1,3]).pipe(\n  finalizeWithValue((lastEmittedValue) =\u003e console.log(lastEmittedValue)) // 3\n)\n\n```\n\n### Want to learn RxJS?\nTry my [\"Hands-on RxJS for Web Development\"](https://www.udemy.com/course/hands-on-rxjs-for-web-development/) video-course!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkievsash%2Frxjs-toolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkievsash%2Frxjs-toolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkievsash%2Frxjs-toolbox/lists"}