Very simple typeclass around the concept of enabled/disabled.
The Findable typeclass represents the ability to "find" within a given entity.
This typeclass represents the ability to put the browser "focus" on something on-screen.
Functions for manipulating the cookies that are set in the DOM.
Functions for manipulating the cookies that are set in the DOM.
Note this code, which seems to be the most complete solution, but is kind of insane:
https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie/Simple_document.cookie_framework
This provides some inspiration, but we're going to make the simplifying assumption (for now) that we are reading the same cookies we are writing, so we don't have to be as forgiving about formatting. (And we aren't going to abuse regular expressions so horribly.) PRs welcome to make this more forgiving.
At least for now, we are assuming that all cookies use the root path and current domain, which is typically appropriate for SPAs.
Note that both keys *and* values get encoded, so that things should be generally Unicode-safe.
NOTE: this code is not yet tested!