@@ -31,25 +31,27 @@ export default function withMountWhenInView(BaseClass, defaultOptions = { thresh
3131 * @type {Object }
3232 */
3333 static config = {
34- ...( BaseClass . config || { } ) ,
35- name : `${ BaseClass ? .config ? .name ?? '' } WithMountWhenInView` ,
34+ ...BaseClass . config ,
35+ name : `${ BaseClass . config . name } WithMountWhenInView` ,
3636 options : {
37- ...( BaseClass ? .config ?. options || { } ) ,
37+ ...( BaseClass . config ?. options || { } ) ,
3838 intersectionObserver : Object ,
3939 } ,
4040 } ;
4141
4242 /**
4343 * Is the component visible?
44+ * @private
4445 * @type {Boolean }
4546 */
46- #isVisible = false ;
47+ __isVisible = false ;
4748
4849 /**
4950 * The component's observer.
51+ * @private
5052 * @type {IntersectionObserver }
5153 */
52- #observer ;
54+ __observer ;
5355
5456 /**
5557 * Create an observer when the class in instantiated.
@@ -59,11 +61,11 @@ export default function withMountWhenInView(BaseClass, defaultOptions = { thresh
5961 constructor ( element ) {
6062 super ( element ) ;
6163
62- this . #observer = new IntersectionObserver (
64+ this . __observer = new IntersectionObserver (
6365 ( entries ) => {
6466 const isVisible = entries . reduce ( ( acc , entry ) => acc || entry . isIntersecting , false ) ;
65- if ( this . #isVisible !== isVisible ) {
66- this . #isVisible = isVisible ;
67+ if ( this . __isVisible !== isVisible ) {
68+ this . __isVisible = isVisible ;
6769
6870 if ( isVisible ) {
6971 this . $mount ( ) ;
@@ -75,10 +77,10 @@ export default function withMountWhenInView(BaseClass, defaultOptions = { thresh
7577 { ...defaultOptions , ...this . $options . intersectionObserver }
7678 ) ;
7779
78- this . #observer . observe ( this . $el ) ;
80+ this . __observer . observe ( this . $el ) ;
7981
8082 this . $on ( 'terminated' , ( ) => {
81- this . #observer . disconnect ( ) ;
83+ this . __observer . disconnect ( ) ;
8284 } ) ;
8385
8486 return this ;
@@ -90,7 +92,7 @@ export default function withMountWhenInView(BaseClass, defaultOptions = { thresh
9092 * @return {this }
9193 */
9294 $mount ( ) {
93- if ( this . #isVisible ) {
95+ if ( this . __isVisible ) {
9496 super . $mount ( ) ;
9597 }
9698
0 commit comments