Created
March 19, 2021 12:54
-
-
Save Raja0sama/9318d9cb008cdaed2800e8dd935fb6d8 to your computer and use it in GitHub Desktop.
Accessing App Reference in UMI for the store.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import | |
import { getDvaApp } from 'umi' | |
// DVA store. | |
const store = getDvaApp()?._store | |
// function, this is how you can access dispatch | |
export function dispatch(action) { | |
return getDvaApp()?._store.dispatch(action); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment