mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28:41 -09:00
* pass `uid` to term * term: keep track of term instance references * sessions: remvoe `write` object overhead * hterm: cache measurement of codepoints for single char strings * sessions: merge less eagerly when we receive a PTY_DATA action * store: handle the side effect of writing to the terminal from a middleware * terms: add terms instance cache * lint
14 lines
360 B
JavaScript
14 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);
|
|
};
|