shinyworks / cookies

Use Browser Cookies with 'shiny'
https://shinyworks.github.io/cookies/
Other
32 stars 4 forks source link

Support `JSON.stringify` of objects #77

Closed yogat3ch closed 10 months ago

yogat3ch commented 10 months ago

Hi @jonthegeek! I was wondering if cookies can support JSON.stringify of objects passed as the cookie_value? This will allow for a simplification of usage where a single app cookie object with a bunch of values can be written/read.

jonthegeek commented 10 months ago

I definitely like the idea, but I don't think I like where you put it. That should be a fairly dumb bridge between the R code and the JS code. I want to make sure we're doing this in a place where we can control the error messaging (and, eventually, logging).

That said, I'd rather have it and then refactor, than not have it at all. Looking at the code, the place I'd put it isn't cleanly available right now; I really need to do some work on this package overall!

Soooo.... ok, I'll go ahead and accept this, but I'm writing an issue or three first to make sure I fix it 🙃