If I have the following interface in typescript

```
interface Member {
   readonly id: number;
   readonly name: string;
   readonly email: string;
   groups: <ReadonlyArray>Group
}

interface Group {
   readonly id: number;
   readonly name: string;
   readonly active: boolean;
}

```

Data would look something like this

```
member {
   id: 1,
   name: 'John Doe',
   email: 'junk@junk.com'
   groups: [
      { id: 1, name: 'Group 1', active: true}
      { id: 2, name: 'Group 2', active: false}
      { id: 3, name: 'Group 3', active: false}
   ]
}

```

If I wanted to store this in akita/state and allow it to be mutable (ie maybe a user wants to click a checkbox to say 'Group 2' is now active and I need to update the akita/state), how do I make a copy of the entire object so it is not immutable (before inserting into akita/state)?

Ok, I wanted to edit my question after reading below comments.

I have the following code inserting into my akita store

```
  loadMemberById(memberId: number) {
    const request$ = this.membersDataService.getById(memberId).pipe(
      tap(response => this.membersStore.upsert(response.id, response)),
      tap(response => this.membersStore.upsert(response.id, { groups: { 
         ...response.groups } })),
      tap(response => this.membersStore.setHasCache(true))
    );

    return cacheable(this.membersStore, request$);
  }

```

VS is complaining about `state.member.groups` inside of `arrayUpdate`

```
  update(groupId: number, value: boolean): Observable<void> {
    const observer = this.groupsDataService.update(groupId, value);

    observer.subscribe(() => {
      this.sessionStore.update(state => {
        return {
          member: {
            ...state.member,
            groups: arrayUpdate(state.member.groups, data => data.groupId === 
                groupId, {
                    active: value
            })
          }
        };
      });
    });

```

Thx
jonpfl