number of stored value

45 views
Skip to first unread message

Khashayar Parhami

unread,
Sep 20, 2012, 1:05:51 AM9/20/12
to Amplify
Hi,
How can I find out if there is any value stored or the storage is
empty?
Thanks

Scott González

unread,
Sep 20, 2012, 10:38:24 AM9/20/12
to ampl...@googlegroups.com
You can call amplify.store() with no parameters and it will return a hash of all values. So you can check if that hash is empty to determine if their is anything in the storage:

function isEmpty({
    for var key in amplify.store({
        return false;
    }
    return true;

Khashayar Parhami

unread,
Sep 20, 2012, 7:04:28 PM9/20/12
to Amplify
Thank you so much
Reply all
Reply to author
Forward
0 new messages