here is some ts code:
type TopRoomInfoState = {
loaded: false;
loading: boolean;
error: any;
data: null;
} | {
loaded: true;
loading: boolean;
error: any;
data: GetTopRoomInfoRsp;
}
const inititalState: TopRoomInfoState = {
loaded: false,
loading: false,
error: null,
data: null,
};
type Test = typeof inititalState;
// but this `type Test` is merely the literal type of `const inititalState`
// not the whole union TopRoomInfoState ...
and why the type Test is the subset of the union TopRoomInfoState ?? how to make type Test is whole the union type ?
