简体   繁体   中英

How to initialize root store in angular-redux/store for testing?

I want to set the initial root Store for angular redux instead of calling getSelectorStub for one selector at a time. What's the best way to do this?

StoreModule.forRoot() contains an optional configuration object as input parameter.

 StoreModule.forRoot(reducers, {
      initialState: {} // <---- provide initial state
 }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM