mikehadlow / gtr-cof

Interactive music theory dashboard for guitarists. http://guitardashboard.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

save on cookies

sugizo opened this issue · comments

because of user behaviour (different for each person) better to save on cookies for :

  • left handed fretboard (settings)
  • flip nut (settings)
  • set c to noon (settings)
  • tunings
  • scale

thanks

Agreed. The cookie saving implementation is really broken. I need to have a better idea about how to implement this. I'd also like to have a way of saving the current state in the URL, so that a teacher could send a link to their students with the scale, chords, and notes already selected, and a single scheme to store all of this would be ideal.

brilliant to put some on URL :

  • scale
  • root note
  • tuning
  • chord selected

but some data need to save on cookies too, because not everybody is same :

  • left handed option
  • flip nut
  • set c to noon

Good point. Although 'c to noon' would probably be an instructors choice, no?

trying to modify cookie-module.ts but not success (no error occured, but the result is not expected

    export function init(): void {
        events.scaleChange.subscribe(bakeCookie);
        events.tuningChange.subscribe(bakeCookie);
    }

    function bakeCookie(scaleChange: events.ScaleChangedEvent, tuningChange: events.TuningChangedEvent): void {

when put it solely just it can work to store the value (tuningChange)

    export function init(): void {
        events.tuningChange.subscribe(bakeCookie);
    }

    function bakeCookie(tuningChange: events.TuningChangedEvent): void {

not sure where is my mistake, perhaps you can give a pointer, thanks

after rethink again, not everyone is a student, some is autodidact that need guitardashboard.com to enlarge their knowledge in music
put some on URL (for assigned or topic discussed from instructor to their student) :

  • scale
  • root note
  • tuning
  • chord selected

and save everything on cookies too for autodidact :

  • left handed (settings)
  • flip nut (settings)
  • set c to noon (settings)
  • scale
  • root note
  • tuning
  • chord selected

what do you think ?

The argument to subscribe is a function that takes the event as its argument. So you'd need two different bakeCookie functions, one for ScaleChangedEvent, and another for TuningChangedEvent. I'm surprised that even compiled to be honest.

I'm a firm believer in 'keep it simple'. 90% of people don't read manuals or investigate features. I would go for re-creating the entire state rather than having some complicated scheme for storing a subset of settings.

Awesome tool! Thanks for this! Was going to ask about the share link function that saves the current state ... some sort of "Share this" button that displays and copies shareable link with the state would be nice.

Thanks @amiika, yes, that's something I'd like to implement. I think it'd be useful for teachers especially.