Skip to content

Difference between single and find? #6107

Answered by madebyjeffrey
Sawtaytoes asked this question in Q&A
Discussion options

You must be logged in to vote

Read the documentation carefully, you will notice that single will throw an error in the event more than one item emitted, while find emits no errors. There are cases where you only want one item and other cases where you must only have one item.

In C# LINQ there is also a single and first that has the same kind of difference.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Sawtaytoes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants