Indent json

Hello, I have created a JSON code editor using react-codemirror. But I am not able to indent json, I went through different examples but unable to understand how to use transactionFilter as you suggested here
Indent on paste - #2 by marijn .

Could you please give me an idea how to use transaction filter to dispatch following changes.

 view.dispatch({
      changes: indentRange(editorState.current, 0, view.state.doc.length)
 });

here is my working code codesandbox, Thank you in advance!! :pray:

Something like this…

EditorState.transactionFilter.of(tr => tr.isUserEvent("input.paste") ? [
  tr,
  {changes: indentRange(tr.state, 0, tr.state.doc.length), sequential: true}
] : tr)