src/store/Store.js
/**
   * Subscribes a listener function for all state changes
   * @param  {function} listener A listener function to be called when store state changes
   * @return {function}          An unsubscribe function which can be called to remove the listener from state updates
   */
Subscribes a listener function for all state changes
@param  {function} listener A listener function to be called when store state changes
@return {function}          An unsubscribe function which can be called to remove the listener from state updates
Subscribes a listener function for all state changes @param { function } listener A listener function to be called when store state changes @return { function } An unsubscribe function which can be called to remove the listener from state updates
subscribe(listener) {
    this.listeners.push(listener);
    return () => {
      this.listeners = this.listeners.filter((l) => l !== listener);
    };
  }
subscribe ( listener ) { this . listeners . push ( listener ) ; return ( ) => { this . listeners = this . listeners . filter ( ( l ) => l !== listener ) ; } ; }
Subscribes a listener function for all state changes
 @param  {function} listener A listener function to be called when store state changes
 @return {function}          An unsubscribe function which can be called to remove the listener from state updates
Subscribes a listener function for all state changes @param { function } listener A listener function to be called when store state changes @return { function } An unsubscribe function which can be called to remove the listener from state updates