ngneat / elf

🧙‍♀️ A Reactive Store with Magical Powers
https://ngneat.github.io/elf/
MIT License
1.62k stars 93 forks source link

Strange behavior of `selectEntityByPredicate` #532

Open dzolotarova opened 1 month ago

dzolotarova commented 1 month ago

Which @ngneat/elf-* package(s) are the source of the bug?

entities

Is this a regression?

No

Description

I tried using selectEntityByPredicate to find which entity is now isFavorite: true. It can only be one favorite entity at a time. But once an entity is selected, it never becomes unselected, even if it should be (by predicate). Other methods like selectManyByPredicate and selectAllEntitiesApply work correctly and dynamically. Perhaps this behavior was intended for selectEntityByPredicate?

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/vitejs-vite-j8nt1x?file=src%2Fmain.ts

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

No response

Anything else?

No response

Do you want to create a pull request?

No

stackblitz[bot] commented 1 month ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.