decko
decko copied to clipboard
:dash: The 3 most useful ES7 decorators: bind, debounce and memoize
Attempting to use `bind` throws this compilation error: ``` TS1241: Unable to resolve signature of method decorator when called as an expression. Type 'TypedPropertyDescriptor' is not assignable to type 'void...
A short term solution. Long term I'd prefer to see a real debounce included, since I use that way more often personally.
This snippet demonstrates that the `bind` decorator does not work correctly on second method call if that method invokes super method which in turn is also decorated: ```javascript class A...
(tested in Typescript) ``` import { memoize } from 'decko'; class Stores(){ } class Container { @memoize public get stores () { return new Stores(); } } ``` Throws an...
In the [docs](https://github.com/developit/decko#debounce) its says: > To debounce means "call this at most once per N ms". All outward function calls get collated into a single inward call, and only...
I saw you use first argument as key of cache. What if the first argument is an object, like this: ```js const a = {}; const b = {c: {}}...
These things are unclear from the current documentation about the options: - How to use options - What are the default values It is possible to look them up in...