add alternative way of adding actions
See original GitHub issueI’m planning to add a very simple way of adding actions as string.
At the moment actions can be added like this:
const store = new Vapi({
baseURL: 'https://foobar.com',
/*...*/
})
.get({
property: 'post',
action: 'getPost',
path: ({id}) => `posts/${id}`
})
The alternative version I’m looking forward to looks like this:
const store = new Vapi({
baseURL: 'https://foobar.com',
/*...*/
})
.add('GET posts/:id INTO post AS getPost')
Or maybe like this:
const store = new Vapi({
baseURL: 'https://foobar.com',
/*...*/
})
.add("get", ({ id }) => `posts/${id}`, "post", "getPost")
One nice side effect would be that you didn’t have to write the path function if it’s that easy. The params will be detected (e.g. :id
) and automatically added.
Please consider: This is just a draft. I’ll maybe change the syntax or did overlook some problems.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How do I add actions to Photoshop? - website builder
Another way to add actions is to use the keyboard. You can hold down the Option (Alt) key and type “A” to open...
Read more >Customize actions on your messages in Outlook.com
Go to the type of actions you want to add. Select the check boxes for the actions you want. They'll appear in the...
Read more >How To Install Photoshop Actions - Greater Than Gatsby
From the drop-down menu, select “Load Actions”. Navigate back to where you saved the actions and select the file ending in “. atn”....
Read more >Adding New Actions or Workflows - Junxure Support
To continue or add on to a Workflow, navigate to the Action Card you want to continue from. Use the More menu and...
Read more >How to Use Photoshop Actions and New Conditional Actions
In this tutorial you will learn how to Use Actions and New Conditional Actions. Actions are automated chain of commands that are executed ......
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
@slurmulon Thanks for your input! I agree with all of your arguments. If someone really wants to have a “simpler” approach he/she could write an helper method to please his needs. =)
I wrote a detailed comment on this proposed change in a less relevant issue (whoops!):
https://github.com/christianmalek/vuex-rest-api/issues/54#issuecomment-429187894