Using isEmpty from view.state.field(state, false);

can I use the isEmpty property on RangeSet safely?

const field = view.state.field(foldState, false);
if (field) {
     setCodeIsFolded(!field.isEmpty);
}

If it isn’t in the docs, don’t use it. .size == 0 works and is public.

1 Like