addons-actions: option to return something
See original GitHub issueIs your feature request related to a problem? Please describe.
We have stories with callbacks that should return Promise.
storiesOf('Some Form', module).add('Default', () => (
<Form initialValues={{}} onSubmit={action('Submit')} />
));
Form onSubmit prop: onSubmit: Promise<void>;
Describe the solution you’d like Option to specify a return value, either with a function or directly the value we want to return ?
storiesOf('Some Form', module).add('Default', () => (
<Form initialValues={{}} onSubmit={action('Submit', { returnValue: Promise.resolve() )} />
));
storiesOf('Some Form', module).add('Default', () => (
<Form initialValues={{}} onSubmit={action('Submit', { getReturnValue: (values) => Promise.resolve() )} />
));
I’m not sure about the naming
Describe alternatives you’ve considered
Allowing onSubmit
return type to accept void.
Are you able to assist bring the feature to reality? yes, I can open a PR if it’s accepted
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Return Items You Ordered - Amazon Customer Service
Choose the order and select Return or Replace Items. Select the item you want to return. Then select an option from the Reason...
Read more >Returning items you bought from Microsoft Store for exchange ...
Learn how to receive a Microsoft refund or exchange for items purchased or unexpected charges from ... Refunds are applied to the original...
Read more >Amazon offers free returns with no box, tape, or label needed
Amazon makes returns even easier with thousands of free drop off options for millions of items. Our goal at Amazon is to make...
Read more >Process a Return or Exchange with Square for Retail
With Square for Retail Plus, you will have the option to either process a ... With Square for Retail, you can process a...
Read more >Return an item - Google Store Help
You can return most items you bought from the Google Store within 15 calendar days after the day you receive it. Returns are...
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
I don’t think these workarounds work with the new actions approach (e.g. ‘action’ is not imported) - just hit this exact issue myself.
You can try this: