Skip to content

Retrieving value which are not set by Lockr #57

@gokatz

Description

@gokatz

Thanks for this super tiny package that elegantly handles the localStorage 🙂

I can see that Lockr is not designed to retrieve data that are not set by itself. Can we make it to retreive the data that are not set by Lockr with the help of options argument ?

like,

window.localStorage.setItem('nameObj', JSON.stringify({first: 'Gokul', last: 'Kathirvel'}));

Lockr.get('nameObj');
// undefined

Lockr.get('nameObj', null, { processRaw: true });
// {first: 'Gokul', last: 'Kathirvel'}

or if the fetched value from storage is not abiding the structure (.data), then we can return the actual fetched value itself like this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions