lockr icon indicating copy to clipboard operation
lockr copied to clipboard

es6 import modules support

Open roblav96 opened this issue 8 years ago • 3 comments

Recently switching my projects to es6 with babel, I'd like to do something like this with lockr:

import {
    get,
    set,
} from 'lockr'

but when I call get this error throws:

TypeError: Cannot read property '_getPrefixedKey' of undefined
var query_key = this._getPrefixedKey(key, options)

Not a big deal; importing the entire library is not a problem because it's small and minimal.

Thank you =]

roblav96 avatar May 24 '16 18:05 roblav96

@roblav96 good catch. I've never used Lockr in ES6 env, but I know why it doesn't work. It will require a major refactor on how the lib works under the hood.

tsironis avatar May 26 '16 07:05 tsironis

No worries at all man! Still loving lockr to death haha

roblav96 avatar May 26 '16 12:05 roblav96

I would appreciate a pull request, if you want to give it a try!

tsironis avatar May 27 '16 10:05 tsironis