mydea / ember-indexeddb

Utilities & adapter to work with IndexedDB in ember & ember-data
https://mydea.github.io/ember-indexeddb/docs/
MIT License
17 stars 5 forks source link

Consider dropping (unused?) jQuery #8

Closed jacobq closed 5 years ago

jacobq commented 5 years ago

I haven't looked through other files yet, but I noticed that jQuery is imported here but apparently not used. https://github.com/mydea/ember-indexeddb/blob/master/addon/adapters/indexed-db.js#L6

mydea commented 5 years ago

We use $.extend() right now to deep-clone options. But I guess this would be easy to refactor - I'll take a stab when I find some time. I would also accept a PR for that :)

jacobq commented 5 years ago

I wasn't even going that far -- just saying that you could remove it from addon/adapters/indexed-db.js without any other changes.

mydea commented 5 years ago

That is not true, it is indeed used here: https://github.com/mydea/ember-indexeddb/blob/master/addon/adapters/indexed-db.js#L266

let record = $.extend(true, {}, data.data);
jacobq commented 5 years ago

:man_facepalming: You're right; I'm sorry. Scanning through with Ctrl+F I only saw the template usages.

mydea commented 5 years ago

No worries ;)

jacobq commented 5 years ago

FWIW, _.cloneDeep offers the same functionality (I believe) and can be brought in on its own.

mydea commented 5 years ago

BTW, I have since replaced this with a non-jQuery version, so this addon is now jQuery free.