Closed
Description
with tsconfig compilerOptions.module = esnext
, the compiled code using __webpack_require__.d
& it's using defineProperty
// define getter function for harmony exports
__webpack_require__.d = function(exports, name, getter) {
if(!__webpack_require__.o(exports, name)) {
Object.defineProperty(exports, name, { enumerable: true, get: getter });
}
};
will make code like
// @file src/models/index.ts
import count from './count'
export count
// @file src/store.ts
import * as models from './models/index'
models will have a count
property with a getter.
final with the created store, the count model is lost.
when use useStoreState(state => state.count.num)
will throw a error
demo code see
https://github.com/magicdawn/easy-peasy-demo
commit 1fd420c
Metadata
Metadata
Assignees
Labels
No labels