matthewp / gazel

Key/value store for the browser
https://matthewphillips.info/code/gazel/index.html
MIT License
122 stars 6 forks source link

Emitting events. #11

Closed scottcorgan closed 11 years ago

scottcorgan commented 11 years ago

Can't find any documentation on create/update/delete events being emitted. Is this a feature? If not, what would it take to be implemented?

matthewp commented 11 years ago

Hey! No, not a feature. I meant for that type of thing to be added, that's why errors are done through client.on('error', function(){}). So emitting those types of events shouldn't be too much work. What is your use case for using them, just wondering?

scottcorgan commented 11 years ago

I'd like to always save to gazel.js and then listen for changes to sync those to a server (similar to how hood.ie uses localstorage).

Appreciate your response.

matthewp commented 11 years ago

Cool, I think I'm going to have some free time this weekend so I'll look into it.

scottcorgan commented 11 years ago

Appreciate it. I planned on looking into it as well. When/if I do, I'll submit a PR

matthewp commented 11 years ago

We can't really do a create/update because we don't check to see if the value exists before saving and I wouldn't want to add that overhead just for the sake of an event. However we could do a set and delete event.

scottcorgan commented 11 years ago

That might he a great start! On Aug 23, 2013 3:30 PM, "Matthew Phillips" notifications@github.com wrote:

We can't really do a create/update because we don't check to see if the value exists before saving and I wouldn't want to add that overhead just for the sake of an event. However we could do a set and delete event.

— Reply to this email directly or view it on GitHubhttps://github.com/matthewp/gazel/issues/11#issuecomment-23193552 .

matthewp commented 11 years ago

Let me know how that works @scottcorgan. I've updated the documentation on gazeljs.org (Events is in the top navigation).

matthewp commented 11 years ago

I'm going to close this, feel free to reopen if something isn't working.