src/utils/processShapeMapPath.js
function getAllPathsAndOptionallySlice(paths, state, slice = Immutable.List())
{
	let gotPaths = Immutable.List();

	gotPaths = gotPaths.withMutations((mutable) =>
	{
		paths.forEach((gen) =>
		{
			if (state.hasIn(gen))
			{
				let got = state.getIn(gen);
				if (Immutable.List.isList(got))
				{
					if (slice.size > 0)
					{ mutable.push(...got.slice(...slice)) }
					else
					{ mutable.push(...got) }
				}
				else
				{
					mutable.push(got);
				}
			}
		})
	});

	return gotPaths;
}
function getAllPathsAndOptionallySlice(paths, state, slice = Immutable.List())
{
	let gotPaths = Immutable.List();

	gotPaths = gotPaths.withMutations((mutable) =>
	{
		paths.forEach((gen) =>
		{
			if (state.hasIn(gen))
			{
				let got = state.getIn(gen);
				if (Immutable.List.isList(got))
				{
					if (slice.size > 0)
					{ mutable.push(...got.slice(...slice)) }
					else
					{ mutable.push(...got) }
				}
				else
				{
					mutable.push(got);
				}
			}
		})
	});

	return gotPaths;
}
Get all the paths and put their contents to a single list (and optionally slice the contents)