components-js icon indicating copy to clipboard operation
components-js copied to clipboard

context refactor

Open Ocupe opened this issue 1 year ago • 2 comments

Out of 52 publicly exposed hooks, 17 are related to context handling in some way. They clutter up our docs a bit and seem more important than they really are. I think we can combine most of the functionality and reduce them to 5:

useLayoutContext
useMaybeLayoutContext
useEnsureLayoutContext
3 -> 1
useCreateLayoutContext
useEnsureCreateLayoutContext
2 -> 1
useRoomContext
useMaybeRoomContext
useEnsureRoom
3 -> 1
useParticipantContext
useEnsureParticipant
useMaybeParticipantContext
3 -> 1
useTrackRefContext
useEnsureTrackRef
useMaybeTrackRefContext
3 -> 1
useTrackContext
useEnsureTrackReference
useMaybeTrackContext
3 -> 0 // after deprecated and removed

Ocupe avatar Sep 13 '23 15:09 Ocupe