I have the following state structure:

```
{ entities:
1: {name: "Basketball", id: "1", leagues: Array(3)}
2: {name: "Volleyball", id: "2", leagues: Array(3)}
3: {name: "Soccer", id: "3", leagues: Array(0)}
}

```

Now I just want to remove an item with the id '3' lets say.

The following does not work:

```
const state = ctx.getState();
    delete state.entities[action.id];

    ctx.setState(
      patch<SportTypeStateModel>({
        entities: {...state.entities},
        IDs: state.IDs.filter(id => id !== action.id)
      })
    );

```

It throws the following error:

```
`ERROR TypeError: Cannot delete property '3' of [object Object]`

```

What is the right way of doing this?