sampotts / shr

Simple, clean, and customizable social sharing buttons.
MIT License
152 stars 22 forks source link

When we increment on click, should we update storage? #17

Open danpastori opened 6 years ago

danpastori commented 6 years ago

Problem

We have a flag for incrementing the count on click. This doesn't update the storage so if I refresh the page my click isn't stored.

Rationale

It can be kind of misleading when I see an increment, refresh the page and it isn't there.

Solution

Update the storage if increment is set.

Pros of Solution:

Refreshing the page will show the new share.

Cons of Solution:

If I click and didn't share, then the number will be wrong and won't correct itself until the cache expires.

Let me know your thoughts on this and we can find a way to resolve this issue!

sampotts commented 5 years ago

I'd say no on this since the increment assumes the share took place. It would get confusing if we're manipulating the source data. Perhaps what we could do is invalidate the cache for that URL/network on click?