function subscribe(listener) {
    if (typeof listener !== 'function') {
      throw new Error('subscribe: listener is not a valid function');
    }

    currentListeners.push(listener);
  }
// Will add the listener function to a list of functions that will trigger whenever state changes
Will add the listener function to a list of functions that will trigger whenever state changes
Will add the listener function to a list of functions that will trigger whenever state changes
function subscribe(listener) {
    if (typeof listener !== 'function') {
      throw new Error('subscribe: listener is not a valid function');
    }
    currentListeners.push(listener);
  }
function subscribe ( listener ) { if ( typeof listener !== 'function' ) { throw new Error ( 'subscribe: listener is not a valid function' ) ; } currentListeners . push ( listener ) ; }
Will add the listener function to a list of functions that will trigger whenever state changes
Will add the listener function to a list of functions that will trigger whenever state changes