Skip to content

fix(event-store): add dispatch supports the form of Promise #32

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Thunder7991
Copy link

 let obj = {
        funcTest: (...args) => {
            return new Promise((resolve, reject) => {
                resolve('event')
            })
        },
      };
      const dispatch = (actionName, ...args) => {
        const actionFn = obj[actionName];
        actionFn.apply(this, [1, 2, 3]);
      };

      dispatch('funcTest').then(res => {
        console.log(res);
      })

Uncaught TypeError: Cannot read properties of undefined (reading 'then')
缺少返回值

@Thunder7991 Thunder7991 changed the title add dispatch supports the form of Promise fix(event-store): add dispatch supports the form of Promise Dec 26, 2023
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.

1 participant