Skip to content

Instantly share code, notes, and snippets.

@adamwiggins
Last active May 17, 2017 14:48
Show Gist options
  • Save adamwiggins/ae073eaec2831a34b4b2d40f7de96443 to your computer and use it in GitHub Desktop.
Save adamwiggins/ae073eaec2831a34b4b2d40f7de96443 to your computer and use it in GitHub Desktop.

Methods

I guess it's the functional style but I kind of feel like store operations like insert() and remove() should be methods on the store object instead of Tesseract. i.e. instead of

s1 = t.insert(s1.cards, 0, {title: 'Rewrite everything', done: false})

maybe I'd prefer

s1 = s1.insert('cards', 0, {title: 'Rewrite everything', done: false })

String vs symbol

I find it confusing that sometimes I use a string to reference the object name and sometimes a symbol. i.e. I use the string "cards" here

t.set(s1, 'cards', [])

but the symbol cards here

t.remove(s1.cards[1])

not sure if this is solveable, just pointing out the feeling of inconsistency

key,value vs dictionary

A similar feeling of inconsitency is

t.insert(s1.cards, 1, {title: 'Reticulate splines', done: false})

and

t.set(s1.cards[1], 'done', true)

i.e. one is a hash and one is two parameters. Maybe the latter should be:

t.set(s1.cards[1], { done: true })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment