Set cursor position on load

Is there a way to set the cursor to a specific position on load? Like if a user refreshes the page can I set the cursor back to where it was in the editor before the refresh

You can pass in a selection when creating an editor state.