icelam / random-name-picker

Simple HTML5 random name picker for picking lucky draw winner using Web Animations and AudioContext API.
https://pinkylam.me/playground/random-name-picker
MIT License
115 stars 140 forks source link

feat: persist the list of names in localstorage so it survives across refreshes #3

Closed Dombo closed 1 year ago

Dombo commented 1 year ago

Description

This introduces local storage capability so that the list of names persists between refreshes and browser/open close.

How has this been tested?

Locally during development, exercised by the linter.

Types of changes

Remarks

Was pretty easy to contribute (:

icelam commented 1 year ago

@Dombo Thanks for submitting this PR. I actually want to preserve the refresh as a reset of the whole app as I think it would be a more generic use case of this application where an event would finish the lucky draw in a short period of time (usually within couple of hours). Is there any reason you think that preserving name list in local storage would be useful?

Dombo commented 1 year ago

@icelam I suspect some people (me for example) might want to use this to draw a name from the same list across seperate sessions/uses. Without having to keep adding a list from some other place they track it like a note or soemthing

Do you have a suggested way forward for this PR?

icelam commented 1 year ago

Understand the use case you describe. However, I am more keen on preserving the original behaviour for the following reasons:

I truly appreciate the effort you've put into this PR. However, in consideration of both generality with regards to features being introduced and to preserve the user experience, I currently wouldn't prefer to complicate this application with extra settings in order to suit the needs of different users.

If you think that local storage feature is needed for your specific use case, then you are more than welcome to host your own version of this application as long as you provide attribution in any reasonable manner. This application should be pretty easy to host under GitHub Pages for free. Or if you have any ideas which you want to further discuss, welcome to further comment on this PR.

Dombo commented 1 year ago

I appreciate your detailed reasoning in the reply comment, I'll opt to fork this and take it in my own direction. It's just for personal use anyhow but I'll be sure to attribute it and follow any licence.