在下面的代码中,当我console.log状态时,inspect
就是:
state.product.inspect
ƒ () {
return this.toString();
}
和inspect.showProductReports未定义。为什么?
import type { RecordFactory, RecordOf } from 'immutable'
import { Record } from 'immutable'
type ShowProductReportsProps = {
value: boolean
}
export const makeShowProductReports:
RecordFactory<ShowProductReportsProps> = Record({
value: false
})
export type ShowProductReports = RecordOf<ShowProductReportsProps>
type InspectProps = {
showProductReports: ShowProductReports
}
export const makeInspect: RecordFactory<InspectProps> = Record({
showProductReports: new makeShowProductReports()
})
export type Inspect = RecordOf<InspectProps>
type ProductComponentProps = {
add: any,
search: any,
edit: any,
inspect: any
}
export const makeProduct: RecordFactory<ProductComponentProps> = Record({
add: new makeAdd(),
search: new makeSearch(),
edit: new makeEdit(),
inspect: new makeInspect()
})