Skip to content

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