developit/decko

Is memoize supposed to work on getters?

Open

#15 opened on 2018年2月8日

GitHub で見る
 (2 comments) (8 reactions) (0 assignees)JavaScript (34 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (1,037 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

(tested in Typescript)

import { memoize } from 'decko';

class Stores(){
}

class Container {

    @memoize
    public get stores () {
        return new Stores();
    }
}

Throws an error: ​​Invalid property descriptor. Cannot both specify accessors and a value or writable attribute, #<Object>​​

For reference: https://github.com/darrylhodgins/typescript-memoize does work.

コントリビューターガイド