function getMapDimForSplitMap(isSplit, state) {
  // cases:
  // 1. state split: true - isSplit: true
  // do nothing
  // 2. state split: false - isSplit: false
  // do nothing
  if (state.isSplit === isSplit) {
    return {};
  }

  const width = state.isSplit && !isSplit ?
    // 3. state split: true - isSplit: false
    // double width
    state.width * 2
    // 4. state split: false - isSplit: true
    // split width
    : state.width / 2;

  return {
    width
  };
}
function getMapDimForSplitMap(isSplit, state) {
  // cases:
  // 1. state split: true - isSplit: true
  // do nothing
  // 2. state split: false - isSplit: false
  // do nothing
  if (state.isSplit === isSplit) {
    return {};
  }

  const width = state.isSplit && !isSplit ?
    // 3. state split: true - isSplit: false
    // double width
    state.width * 2
    // 4. state split: false - isSplit: true
    // split width
    : state.width / 2;

  return {
    width
  };
}
function getMapDimForSplitMap ( isSplit , state ) { // cases: // 1. state split: true - isSplit: true // do nothing // 2. state split: false - isSplit: false // do nothing if ( state . isSplit === isSplit ) { return { } ; } const width = state . isSplit && ! isSplit ? // 3. state split: true - isSplit: false // double width state . width * 2 // 4. state split: false - isSplit: true // split width : state . width / 2 ; return { width } ; }
Helpers
Helpers
get map dim for split map