src/SharedStateProvider.js
/**
     * Listen for changes to the specified path
     * @param path The path to listen to changes for
     * @param listener A function that will be executed to inform the caller of the new value. (newValue)=>{}
     * @returns {*} A function to call to stop listening for changes
     */
Listen for changes to the specified path
@param path The path to listen to changes for
@param listener A function that will be executed to inform the caller of the new value. (newValue)=>{}
@returns {*} A function to call to stop listening for changes
Listen for changes to the specified path @param path The path to listen to changes for @param listener A function that will be executed to inform the caller of the new value . ( newValue ) = > {} @returns { * } A function to call to stop listening for changes
listen( path, listener ) {
        if( !this.listeners[ path ] ) this.listeners[ path ] = {}
        let listenerKey = uuid()
        this.listeners[ path ][ listenerKey ] = listener
        let currentValue = paths.getPath( path, this.state )
        if( currentValue ) listener( currentValue )
        let mute = () => {
            if( this.listeners[ path ] ) delete this.listeners[ path ][ listenerKey ]
        }
        mute.bind( this )
        return mute
    }
listen ( path , listener ) { if ( ! this . listeners [ path ] ) this . listeners [ path ] = { } let listenerKey = uuid ( ) this . listeners [ path ] [ listenerKey ] = listener let currentValue = paths . getPath ( path , this . state ) if ( currentValue ) listener ( currentValue ) let mute = ( ) => { if ( this . listeners [ path ] ) delete this . listeners [ path ] [ listenerKey ] } mute . bind ( this ) return mute }
Listen for changes to the specified path
 @param path The path to listen to changes for
 @param listener A function that will be executed to inform the caller of the new value.
Listen for changes to the specified path @param path The path to listen to changes for @param listener A function that will be executed to inform the caller of the new value .