fix(core): update
This commit is contained in:
parent
f884807f33
commit
7b9ed9ee78
@ -14,7 +14,7 @@ export class Smartstate<StatePartNameType> {
|
|||||||
initialArg?: PayloadType
|
initialArg?: PayloadType
|
||||||
): StatePart<StatePartNameType, PayloadType> {
|
): StatePart<StatePartNameType, PayloadType> {
|
||||||
if (this.statePartMap[statePartNameArg as any]) {
|
if (this.statePartMap[statePartNameArg as any]) {
|
||||||
if (initialArg) {
|
if (initialArg && Object.keys(initialArg).length > 0) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`${statePartNameArg} already exists, yet you try to set an initial state again`
|
`${statePartNameArg} already exists, yet you try to set an initial state again`
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user