developit/decko

Is memoize supposed to work on getters?

Open

#15 aperta il 8 feb 2018

Vedi su GitHub
 (2 commenti) (8 reazioni) (0 assegnatari)JavaScript (34 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (1037 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

(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.

Guida contributor