I was referring to the share operator. I don’t mind using an imperative solution as long it’s encapsulated inside a function.
I didn’t say your solution isn’t right. I just mentioned why I prefer my solution. Take it easy :) You’re a smart developer.