const createGlobalReactive = ( id = "" , prefix = "gr-" ) => { if ( id [ 0 ] == "#" ) id = id . replace ( '#' , '' ); const _root = id ? document . getElementById ( id ) : document ; if ( ! _root ) throw new Error ( `The id ' ${ id } ' you give to the globalReactive app is invalid as it can't find the root element!` ); const nodes = { _root }; _root . querySelectorAll ( '*' ). forEach ( n => { n . classList . forEach ( c => { if ( c . startsWith ( prefix )) { const key = c . replace ( prefix , '' ); if ( nodes [ key ]){ nodes [ key ]. push ( n ); } else { ...