atlas-engineer / nhooks

MIT License
18 stars 5 forks source link

Should `equals` only compare `place` and not `value`? #13

Open Ambrevar opened 2 years ago

Ambrevar commented 2 years ago

In https://github.com/atlas-engineer/nyxt/pull/2451 we are manually replacing the existing setter handler. This is most certainly something that nhooks should do for us by default.

One possible fix is to change equals so that it only compares the place, and not the value. But then the notion of equality is a bit dubious.

Alternatively, keep equals as it is and just add another check in add-hook to remove existing setter.

@aartaka Thoughts?

aartaka commented 2 years ago

I've not used setter handlers and am unaware of how to actually use those, so I've no idea regarding this change :)

Do we have any documentation and examples of those?

Ambrevar commented 2 years ago

Documentation is in the slots, but examples and tests are lacking. Something more to fix! :)