hyper/lib/store/write-middleware.ts
2020-01-02 21:11:35 +01:00

14 lines
365 B
TypeScript

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.term.write(action.data);
}
}
next(action);
};