tonyito/use-state-plus

Nested state

martinsura opened this issue · 0 comments

Hello,
First nice idea and libs. Playing with use-state-plus and thinking about nested state. For example

type CurrentUser = {
  name:string,
  roles: {
    isAdmin:boolean
  }
}

const { roles } = useStatePlusLite<CurrentUser>({...});

Is here any workaround or methos, how to get isAdmin as state?

I can get state via roles.get().isAdmin but result is plain object not the state object.

Thanks and again nice job