import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
export const setNodeSelection = (view, pos) => {
  const {
    state,
    dispatch
  } = view;
  if (!isFinite(pos)) {
    return;
  }
  const tr = state.tr.setSelection(NodeSelection.create(state.doc, pos));
  dispatch(tr);
};