
export const canShow = (page) => ({
  show() {
    page.div.style.display = 'block';
    if (typeof page.onShow === 'function') {
      page.onShow();
    } else {
      console.log('Warning : class ' + page.className + ' needs to implement onShow()');
    }
  }
});

export const canHide = (page) => ({
  hide() {
    page.div.style.display = 'none';
    if (typeof page.onHide === 'function') {
      page.onHide();
    } else {
      console.log('Warning : class ' + page.className + ' needs to implement onHide()');
    }
  }
});

export const hasConnectionState = (page) => ({
  getConnectionStatus() {
    return page.connectionStatus.innerText;
  },

  setConnectionStatus(connectionStatus) {
    page.connectionStatus.innerText=connectionStatus;
  }
});
