We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(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>
Invalid property descriptor. Cannot both specify accessors and a value or writable attribute, #<Object>
For reference: https://github.com/darrylhodgins/typescript-memoize does work.
The text was updated successfully, but these errors were encountered:
No, it's not working with getters since decorator method in source code doesn't check if you're applying decorator on regular method or getter:
function decorator(fn) { return opt => ( typeof opt==='function' ? fn(opt) : (target, key, desc) => { desc.value = fn(desc.value, opt, target, key, desc); } ); }
This would work with getters:
function decorator(fn) { return opt => ( typeof opt==='function' ? fn(opt) : (target, key, desc) => { if (desc.value) desc.value = fn(desc.value, opt, target, key, desc); if (desc.get) desc.get = fn(desc.get, opt, target, key, desc); } ); }
Sorry, something went wrong.
PR welcome!
No branches or pull requests
(tested in Typescript)
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.
The text was updated successfully, but these errors were encountered: