Lazy Loading
<!--- ./views/someview.bxm|cfm --->
<div>
#wire( "SlowComponent" )#
</div>// ./wires/SlowComponent.bx
class extends="cbwire.model.Component" {
function onMount() {
sleep( 2000 ); // Make this component slow
}
}// ./wires/SlowComponent.cfc
component extends="cbwire.model.Component" {
function onMount() {
sleep( 2000 ); // Make this component slow
}
}<!--- ./wires/slowcomponent.bxm --->
<bx:output>
<div>
<h1>Slow Component</h1>
</div>
</bx:output><!--- ./wires/slowcomponent.cfm --->
<cfoutput>
<div>
<h1>Slow Component</h1>
</div>
</cfoutput>#wire( name="SlowComponent", lazy=true )#Placeholder
Placeholder using ColdBox view
Was this helpful?