(state, action)
| 9 | import { VideoContainer, MainContainer } from "./styles/appStyles"; |
| 10 | |
| 11 | const appReducer = (state, action) => { |
| 12 | switch (action.type) { |
| 13 | case "track": { |
| 14 | state.stream.addTrack(action.track); |
| 15 | return { ...state, stream: state.stream }; |
| 16 | } |
| 17 | case "info": { |
| 18 | return { ...state, viewers: action.viewers }; |
| 19 | } |
| 20 | |
| 21 | default: { |
| 22 | return { ...state }; |
| 23 | } |
| 24 | } |
| 25 | }; |
| 26 | |
| 27 | const initialState = { |
| 28 | stream: new MediaStream(), |
nothing calls this directly
no outgoing calls
no test coverage detected