setLayerVisibility = (layerName, bVisible) => {
  const { ChangeElementCommand } = svgCanvas.history
  const drawing = svgCanvas.getCurrentDrawing()
  const prevVisibility = drawing.getLayerVisibility(layerName)
  const layer = drawing.setLayerVisibility(layerName, bVisible)
  if (layer) {
    const oldDisplay = prevVisibility ? 'inline' : 'none'
    svgCanvas.addCommandToHistory(
      new ChangeElementCommand(
        layer,
        { display: oldDisplay },
        'Layer Visibility'
      )
    )
  } else {
    return false
  }

  if (layer === drawing.getCurrentLayer()) {
    svgCanvas.clearSelection()
    svgCanvas.pathActions.clear()
  }
  // call('changed', [selected]);
  return true
}
Sets the visibility of the layer. If the layer name is not valid, this function return
`false`, otherwise it returns `true`. This is an undo-able action.
@function module:draw.setLayerVisibility
@param {string} layerName - The name of the layer to change the visibility
@param {boolean} bVisible - Whether the layer should be visible
@returns {boolean} true if the layer's visibility was set, false otherwise