Skip to content

polymer-localstorage-load only fires if the value has previously been set #404

Closed
@balupton

Description

I have this code:

<polymer-localstorage name="my-name" value="{{myName}}" polymer-localstorage-load="{{getName}}"></polymer-localstorage>
getName: function(){
                while ( !me.myName ) {
                    me.myName = prompt('What is your name?');
                }
            },

But getName never fires if the local storage value hasn't been already set. I would expect that getName always fires, as soon as the value has been fetched, even if the value is undefined.

As originally I had the following in the ready event:

                while ( !me.myName ) {
                    me.myName = prompt('What is your name?');
                }

But the localstorage element hadn't fetched the value yet, so I tried to use the load event instead, but to the same failure.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions