Skip to content

Commit

Permalink
docs: fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
nichitaa authored Sep 6, 2024
1 parent 097205e commit aa8b73c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ const usersHandler = connector.getStreamHandler<WSEvent, User, UserRequest, User
default: [],
})

const scanUsers = (source$) => {
const scanUsers = (request) = (source$) => {
return source$.pipe(
// filter only users types of events
filter(event => event.method === 'v1.users'),
filter(event => event.method === request.method), // e.g.: request.method === 'v1/users'
// throw error if so that handler can catch it
tap((event) => {
if (isError(event)) throw x
Expand Down Expand Up @@ -215,4 +215,4 @@ drop the execution (waiting for response) for current request and continue with
3. `{status: 'ready', request: 1, response: ... }`
4. `{status: 'loading', request: 2, response: undefined}`
5. `{status: 'ready', request: 2, response: ...}` All requests are send in order and each next request is started only after current has at least one emission with status `ready`


0 comments on commit aa8b73c

Please sign in to comment.