mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-14 12:58:39 -09:00
27 lines
524 B
JavaScript
27 lines
524 B
JavaScript
|
|
import { CLOSE_TAB, CHANGE_TAB } from '../constants/tabs';
|
||
|
|
import { userExitSession, setActiveSession } from './sessions';
|
||
|
|
|
||
|
|
export function closeTab (uid) {
|
||
|
|
return (dispatch, getState) => {
|
||
|
|
dispatch({
|
||
|
|
type: CLOSE_TAB,
|
||
|
|
uid,
|
||
|
|
effect () {
|
||
|
|
dispatch(userExitSession(uid));
|
||
|
|
}
|
||
|
|
});
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export function changeTab (uid) {
|
||
|
|
return (dispatch, getState) => {
|
||
|
|
dispatch({
|
||
|
|
type: CHANGE_TAB,
|
||
|
|
uid,
|
||
|
|
effect () {
|
||
|
|
dispatch(setActiveSession(uid));
|
||
|
|
}
|
||
|
|
});
|
||
|
|
};
|
||
|
|
}
|