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

fix(types): change types #732

Merged
merged 1 commit into from
Jan 26, 2021
Merged

fix(types): change types #732

merged 1 commit into from
Jan 26, 2021

Conversation

pa001024
Copy link
Contributor

in vuex with typescript this.$content will not work

example code:

export const actions: ActionTree<AppState, {}> = {
  // ....
  async loadData({ commit }) {
    const data: IData[] = (await this.$content(this.$i18n.locale, "data").fetch().catch(console.error)) as any;
    if (data) {
      commit("UPDATE_DATA", data);
    }
  }
};

it should be typed as 'contentFunc'

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

in vuex with typescript `this.$content` will not work

example code:
```ts
export const actions: ActionTree<AppState, {}> = {
  // ....
  async loadData({ commit }) {
    const data: IData[] = (await this.$content(this.$i18n.locale, "data").fetch().catch(console.error)) as any;
    if (data) {
      commit("UPDATE_DATA", data);
    }
  }
};
```

it should be typed as 'contentFunc'
@atinux atinux requested a review from danielroe January 26, 2021 09:29
@atinux
Copy link
Member

atinux commented Jan 26, 2021

Would love your quick review @danielroe on this if possible

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

Good catch. LGTM 👍

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.

3 participants