Code Explainers

Code explainers tagged #undo-redo

javascript
class HistoryStack {
  constructor(initial = '', limit = 100) {
    this.past = [];
    this.present = initial;

Building an undo/redo history stack

undo-redo state-management debouncing
Intermediate 7 steps
typescript
type EditorState = {
  content: string;
  cursor: number;
};

Undo/redo with two stacks in TypeScript

undo-redo stacks state-management
Intermediate 7 steps