RxJS custom operator
By following the other recipes in this chapter, I have to ask if you've become a fan of RxJS yet. Have you? Well, I am. And in this recipe, you're going to level up your RxJS game. You're going to create your own custom RxJS operator that just taps into any observable stream and logs the values on console. We'll call it the logWithLabel
operator.
Getting ready
The app that we are going to work with resides in start/apps/chapter05/rx-custom-operator
inside the cloned repository:
- Open the code repository in your Code Editor.
- Open the terminal, navigate to the code repository directory and run
npm run serve rx-custom-operator
to serve the project
This should open the app in a new browser tab. If you click the Start Stream
button while you have the Devtools open, you should see the following:
Let's jump into the recipe steps in the next section.