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

Base action types #233

Merged
merged 12 commits into from
May 19, 2020
Merged

Conversation

special-character
Copy link
Contributor

  • Adding types for the base graphql actions so they can be used to dynamically call them.

i.e. I want to call these actions from the RootStore with their string name like:

self[graphqlActionName](......args and stuff)

This currently complains about TS and doesn't have autocomplete for the possible action names I can call. This PR aims to add types so that it is possible to type these actions.

.props({
launchs: types.optional(types.map(types.late(() => LaunchModel)), {}),
launches: types.optional(types.map(types.late(() => LaunchModel)), {}),
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 don't this example has been ran in awhile. The launches and "js" changes above did not come from the new code generation.

@special-character special-character marked this pull request as ready for review May 19, 2020 01:31
/**
* Store, managing, among others, all the objects received through graphQL
*/
export const RootStoreBase = withTypedRefs<Refs>()(MSTGQLStore
.named("RootStore")
.extend(configureStoreMixin([['Todo', () => TodoModel], ['User', () => UserModel]], ['Todo', 'User']))
.extend(configureStoreMixin([['Todo', () => TodoModel], ['User', () => UserModel]], ['Todo', 'User'], "js"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ditto for this change. I don't think this was updated the last time generation code was updated

Copy link
Collaborator

@chrisdrackett chrisdrackett left a comment

Choose a reason for hiding this comment

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

looks good to me!

@chrisdrackett chrisdrackett merged commit d492214 into mobxjs:master May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants