1
我正在使用WebRTC和Redux傳奇。一個要求是,我必須定義peerConnection.onicecandidate
:Redux Saga:如何調用yield +放入嵌套函數中?
function* createPeerConnection(action) {
...
peerConnection = new RTCPeerConnection(servers);
peerConnection.onicecandidate = (event) => {
if (event.candidate) {
yield put({ type: videoSessionActions.SEND_LOCAL_CANDIDATE, payload: event.candidate });
}
}
}
然而,yield put
不在此方法的工作。我將如何改變這一點,以便它與傳說一起工作?