Conversation
| * Retrieves the given action. | ||
| * @param action Action to retrieve (Worker actions take strings). | ||
| */ | ||
| action(action: Action<WorkerState> | string): (...params: any[]) => void; |
There was a problem hiding this comment.
I think this one is already defined on Store, right?
There was a problem hiding this comment.
There was a problem hiding this comment.
Hi @developit, no worries about the time to review (with the recent release of Preact X, I understand). About your question, Unistore's action doesn't work exactly like Stockroom's action. Stockroom takes an Action or a string, and Unistore (afaik) only takes an Action. Also Stockroom returns void where Unistore returns the BoundAction.
developit
left a comment
There was a problem hiding this comment.
Sorry for the super slow review, these look great! Just the one question about Store.action().
|
I'm all for having the JSDoc in the definitions. Had a bit of a debate when I was putting the types together for #22 and ultimately figured it would add to maintenance time (double handling of function docs). 🤔 I know that the TypeScript compiler is capable of linting regular JS via JSDoc. I wonder if definition files could be generated from that... Something I think I'll look into. |
I'm working a lot with TypeScript+Preact+Stockroom, and I needed types to make my workflow even better. Let's make everyone's worflow better with TS 😄