{"id":21956944,"url":"https://github.com/lesomnus/grpc-concierge","last_synced_at":"2026-05-09T15:34:09.916Z","repository":{"id":238431214,"uuid":"746760176","full_name":"lesomnus/grpc-concierge","owner":"lesomnus","description":"gRPC tranport for caching, deduplication, and managing life cycle","archived":false,"fork":false,"pushed_at":"2024-06-17T17:04:17.000Z","size":168,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T19:27:31.533Z","etag":null,"topics":["cache","deduplication","grpc","grpc-typescript","react"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lesomnus.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-01-22T16:12:44.000Z","updated_at":"2024-06-17T17:04:20.000Z","dependencies_parsed_at":"2024-06-17T18:57:31.876Z","dependency_job_id":"2e5795d4-309a-42bf-bedb-a74055af23cb","html_url":"https://github.com/lesomnus/grpc-concierge","commit_stats":null,"previous_names":["lesomnus/grpc-concierge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lesomnus/grpc-concierge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesomnus%2Fgrpc-concierge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesomnus%2Fgrpc-concierge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesomnus%2Fgrpc-concierge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesomnus%2Fgrpc-concierge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lesomnus","download_url":"https://codeload.github.com/lesomnus/grpc-concierge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesomnus%2Fgrpc-concierge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32824382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["cache","deduplication","grpc","grpc-typescript","react"],"created_at":"2024-11-29T08:40:48.709Z","updated_at":"2026-05-09T15:34:09.871Z","avatar_url":"https://github.com/lesomnus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gcpc-concierge\n\ngRPC transport on top of [`timostamm/protobuf-ts`](https://github.com/timostamm/protobuf-ts) that helps you to cache, deduplicate, and abort the request.\n\n## Usage\n\n\u003e Currently only unary call is supported.\n\n### Cache and Deduplication\n\n```ts\nimport { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport'\nimport { Cacher, Hitchhiker } from 'grpc-concierge'\n\nimport { IEchoClient } from './pb/echo.client'\n\nconst transport = new GrpcWebFetchTransport({\n\tbaseUrl: 'https://example.com',\n\tinterceptors: [\n\t\tnew Cacher\u003cIEchoClient\u003e(({ byKey })=\u003e({\n\t\t\t// Cached value will be returned if `msg.value` is same.\n\t\t\thello: byKey(msg =\u003e msg.value)\n\t\t})),\n\t\tnew Hitchhiker\u003cIEchoClient\u003e(({ byKey }) =\u003e ({\n\t\t\t// Request that has the same `msg.value` are processed as a single request.\n\t\t\thello: byKey(msg =\u003e msg.value)\n\t\t})),\n\t],\n})\n```\n\n### React Hook\n\n- Re-rendering the component when the dependent RPC succeeds.\n- Abort RPCs used when the component unmounted.\n\n```tsx\nimport { createServiceContext } from 'grpc-concierge/react'\n\nimport { EchoClient } from './pb/echo.client'\n\nconst [ctx, useService] = createServiceContext({\n\techo: EchoClient\n}, {\n\t// `echo.hello` depends on `echo.hola`.\n\techo: {\n\t\thello: {\n\t\t\techo: ['hola']\n\t\t}\n\t}\n})\n\n// This component rerendered whenever `svc.echo.hola` succeeds.\nfunction EchoComponent(){\n\tconst svc = useService()\n\tsvc.echo.hello()\n\treturn \u003c\u003e...\u003c/\u003e\n}\n```\n\nYou can see more examples at test.\n- [`core/Cacher`](/src/cacher.test.ts) - caches the responses.\n- [`core/Hitchhiker`](/src/hitchhiker.test.ts) - deduplicates the requests.\n- [`react/createServiceContext`](/src/react/ctx.test.tsx) - manages client life cycle.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesomnus%2Fgrpc-concierge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesomnus%2Fgrpc-concierge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesomnus%2Fgrpc-concierge/lists"}