(uid: string | null, data: any, escaped?: boolean | null)
| 163 | } |
| 164 | |
| 165 | export function sendSessionData(uid: string | null, data: any, escaped?: boolean | null) { |
| 166 | return (dispatch: HyperDispatch, getState: () => HyperState) => { |
| 167 | dispatch({ |
| 168 | type: SESSION_USER_DATA, |
| 169 | data, |
| 170 | effect() { |
| 171 | // If no uid is passed, data is sent to the active session. |
| 172 | const targetUid = uid || getState().sessions.activeUid; |
| 173 | |
| 174 | rpc.emit('data', {uid: targetUid, data, escaped}); |
| 175 | } |
| 176 | }); |
| 177 | }; |
| 178 | } |