Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unmappedArgs to story context #68

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ export type StoryContextForLoaders<
TArgs = Args
> = StoryContextForEnhancers<TRenderer, TArgs> &
Required<StoryContextUpdate<TArgs>> & {
/**
* The unmappedArgs are the args that are passed over the channel
* and defined in the story definition. They must be serializable.
*/
unmappedArgs: TArgs;
/**
* The args that are passed on the context are mapped by arg mapping
* and can be filtered by conditional arg filters.
*/
args: Args;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we kind of want to override the args from TArgs to Args here right?
Because they are defined as TArgs in StoryContextUpdate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess they should be Args in StoryContextUpdate too, after all.

hooks: unknown;
viewMode: ViewMode;
originalStoryFn: StoryFn<TRenderer>;
Expand Down