是否可以组合嵌套在以下 struct 中的异径管:
import 'user' from ...
import 'organisation' from ...
import 'auth' from ...
// ...
export default combineReducers({
auth: {
combineReducers({
user,
organisation,
}),
auth,
},
posts,
pages,
widgets,
// .. more state here
});
如果该州具有以下 struct :
{
auth: {
user: {
firstName: 'Foo',
lastName: 'bar',
}
organisation: {
name: 'Foo Bar Co.'
phone: '1800-123-123',
},
token: 123123123,
cypher: '256',
someKey: 123,
}
}
如果auth
减速器具有以下 struct :
{
token: 123123123,
cypher: '256',
someKey: 123,
}
那么,也许spread操作符很方便?...auth
不确定:-(