orpc-client-event-iterator
Use event iterators in oRPC clients.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use event iterators in oRPC clients.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Quick reference for Better Notify configuration, patterns, and common gotchas
Interactive setup wizard for adding Better Notify to a TypeScript/JavaScript project
Context and API guidance for Better Notify — end-to-end typed notification infrastructure for Node.js
Seamlessly use AI SDK inside your oRPC projects without any extra overhead.
Use oRPC inside an Astro project.
Functions to encode and decode base64url strings (URL-safe variant of base64).
| name | oRPC Client Event Iterator |
| description | Use event iterators in oRPC clients. |
| license | MIT |
| metadata | {"author":"Ali Torki","homepage":"https://github.com/ali-master","version":"1.0.0"} |
An Event Iterator in oRPC behaves like an AsyncGenerator.
const iterator = await client.streaming()
for await (const event of iterator) {
console.log(event.message)
}
const controller = new AbortController()
const iterator = await client.streaming(undefined, { signal: controller.signal })
setTimeout(async () => {
controller.abort()
// or
await iterator.return()
}, 1000)
for await (const event of iterator) {
console.log(event.message)
}
Unlike traditional SSE, the Event Iterator does not auto-retry. Use the Client Retry Plugin.
const iterator = await client.streaming()
try {
for await (const event of iterator) {
console.log(event.message)
}
} catch (error) {
if (error instanceof ORPCError) {
// Handle the error
}
}
consumeEventIteratorimport { consumeEventIterator } from '@orpc/client'
const cancel = consumeEventIterator(client.streaming(), {
onEvent: (event) => console.log(event.message),
onError: (error) => console.error(error),
onSuccess: (value) => console.log(value),
onFinish: (state) => console.log(state),
})
setTimeout(async () => {
await cancel()
}, 1000)
This utility accepts both promises and event iterators. Passing a promise lets it infer the correct error type.