Skip to content Skip to sidebar Skip to footer

Using Lawnchair With Typescript

Got a simple problem, which was touched upon in a similar question around the 'this' scope with typescript. I have a storage service which wraps lawnchair for my local storage conc

Solution 1:

As noted in the comments above, this compiles, and I think it ought to run:

public GetAll(callback: Function) {
    returnfunction (callback){
        Lawnchair({ name: this.storeName }, function () {
            this.all(callback);
        });
    }(callback);
};

... but I suspect someone else may be able to weigh in with a more elegant solution.

Solution 2:

Have you tried the following :

publicExists(uniqueIdentifier: string, callback: Function) {
           var me = this;
           Lawnchair({ name: this.storeName }, function (me) {
                me.exists(uniqueIdentifier, callback);
            });
        };

Post a Comment for "Using Lawnchair With Typescript"