Type Props for actions and tasks
See original GitHub issueI’ll bet we can use inputs
to learn the types of params
for actions and tasks, and that would really help the developer experience!
Ideally:
import { Action } from 'actionhero'
export class UserView extends Action {
constructor() {
super();
this.name = "user:view";
this.description = "view the details of a user";
this.outputExample = {};
this.inputs = {
guid: { required: true, type: string },
};
}
async run({ params, response }) {
// we should be able to know that `params` only has the property `guid` and is of type `string`
const user = await User.findByGuid(params.guid);
response.user = await user.formatForApi();
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (11 by maintainers)
Top Results From Across the Web
Types of Props - IATSE Local 470
Hand props are anything handled or carried by an actor. They include staffs, food, weapons, lanterns and candles, canes, staffs, parasols, and practically ......
Read more >Task List App — React and Redux with Typescript Part 2
Create components and dispatch actions. In src folder create components folder. Inside this folder create some components. Header.tsx
Read more >Different Ways to Dispatch Actions with Redux - Pluralsight
No single option is considered the best, as it fully depends on our use case. Let's look at the various ways to dispatch...
Read more >React interactivity: Events and state - Learn web development
In React, we write event handlers directly on the elements in our JSX, ... We want to pass props.tasks into the useState() hook...
Read more >React with Typescript - Type { } is missing the following ...
As you are passing card to ProfileCard component, its passing 4 values in props. {login: string, name: string, key: number, id: number}.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here you go https://github.com/krlicmuhamed/apiauth
Pong! Sorry for the delay, I have been quite busy, but hopefully next week I will be able to help you. Sorry!!