swr
swr copied to clipboard
(WIP) Adding hash config
Adding a function to the configuration to replace stableHash.
This pr is meant to resolve issues discussed in #1846.
It adds a hash function in the configuration that defaults to stableHash.
I haven't written any tests for this, but I have tested this on my personal repository and seen that it works. Can anyone please take a look at this and give me some direction on how to make this ready to merge?
E.g.:
- what tests should I write?
- Am I missing any places I should put the default configuration
- This changes the signature of
serialize. Should I make the hash function inserializeoptional and make it defualt tostableHashinternally?
Seeing the errors, and this needs some work. Will resolve issues next week
Do you need any support here? :)
I have kind of stalled out here. Having a busy week with work and I am out of town this weekend. If anyone wants to take over this, I would not mind at all because I won't be able to get this resolved for at least another week.
There is a lot of work that needs to be done to change the signature of serialize. It might be a better approach to make serialize overridable rather than customHash, but I am not sure if that would work.
I have made an attempt here https://github.com/vercel/swr/pull/1940 but a few tests are failing.