RxJS iif() Creation OperatorRxJS iif() operator is a creation operator used to decide which observable will be subscribed at subscription time. In other words, we can say that the RxJS iif() operator facilitates you to subscribe to the first or second observable according to the condition. Syntax:Following is the syntax of the RxJS iif() creation operator: Or Or Parameter Explanation
Return valueThe RxJS iif() operator returns either the first or second observable, depending on the condition. Let us see some examples of the RxJS iif() operator to understand it clearly. Example 1 (Simple iif)Output: After executing the above example, you will see the following result: Example 2 (iif with default)Output: After executing the above example, you will see the following result:
Next TopicRxJS Operators
|