description and source-code(store) => (next) => (action) => {
switch (action.type) {
case 'SESSION_PTY_DATA':
if (curPid && uids[action.uid] === curPid) setCwd(store, curPid);
break;
case 'SESSION_ADD':
uids[action.uid] = action.pid;
curPid = action.pid;
setCwd(store, curPid);
break;
case 'SESSION_SET_ACTIVE':
curPid = uids[action.uid];
setCwd(store, curPid);
break;
case 'SESSION_PTY_EXIT':
delete uids[action.uid];
break;
case 'SESSION_USER_EXIT':
delete uids[action.uid];
break;
}
next(action);
}