JSFiddle - React, Tailwind, and code Playground

JavaScript

( function ( MYAPI ) {

	// internal value
  
  var wert = 0.5;
  
  // public interface
  
  Object.assign( MYAPI, {
  
  	getValue: function() {
    
    	return wert;
      
    }
    
	} );
 
} )( window.exampleCode = window.exampleCode || {} );

function update() {

  requestAnimationFrame( update );			
  console.log( exampleCode.getValue() ); 
  
};	
		
update();