mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 12:38:39 -09:00
15 lines
360 B
JavaScript
15 lines
360 B
JavaScript
|
|
import terms from '../terms';
|
||
|
|
|
||
|
|
// the only side effect we perform from middleware
|
||
|
|
// is to write to the react term instance directly
|
||
|
|
// to avoid a performance hit
|
||
|
|
export default () => next => action => {
|
||
|
|
if (action.type === 'SESSION_PTY_DATA') {
|
||
|
|
const term = terms[action.uid];
|
||
|
|
if (term) {
|
||
|
|
term.write(action.data);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
next(action);
|
||
|
|
};
|