I have this snippet of code:
setInterval(() => {
const transaction = view.state.replaceSelection('foobar');
const update = view.state.update(transaction);
view.update([update]);
}, 1000);
Based on the documentation, I expect this code to continually replace the contents of the editor with a single ‘foobar’. This is the actual behavior:
Am I using these methods incorrectly? Is there a more direct way of setting the contents to some string value?