davestewart/vue-class-store

Example not working

sadortun opened this issue · 1 comments

Hello @davestewart ,

The other day, I gives a try to your package and had issues getting into work. After way too much too much time, I realised that your example is not working (I think)

On your README in the first example:

  // you can even drill into sub properties!
  'on:some.other.value' = 'log'

Generates error about undefined access.

  1. Is it intentional than some.other.value is undefined ?

  2. I think you want ... = log instead of ... = 'log'

Have a nice day!

Hey hey,

Sorry about that. It's annoying as an end user to struggle with something new, and I always try to make my examples clear.

Actually, the code on this page is more "inspiration" than verbatim examples. For those, check the accompanying demo repository.

Anyway, if you know Vue, and you know watch, then you'll know this is exactly the same functionality; the example path "some.other.value" is just a kind of foo.bar.baz type example; as in, it is up to the reader to understand this.

Sorry about the undefined error; that's basic Vue. Perhaps I could add functionality to check if the value exists first?

Finally, it is the string "log" that is required here. It's the same functionality as Vue watch, and says "use my 'log' function".

Check the Vue docs, they're pretty good!

Anyway, hope you got over all that and are finding the library useful.

Cheers!