Skip to content

Commit

Permalink
#71 remove unnecessary helper methods
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicWatson committed May 11, 2023
1 parent ba80a23 commit 717dfb9
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions helpers/markdownHelpers.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,3 @@
return getSingleton( "Processor@cbmarkdown" ).toHtml( highlighted );
</cfscript>
</cffunction>

<!--- helpers --->
<cffunction name="simpleRequestCache" access="public" returntype="any" output="false">
<cfargument name="key" type="string" required="true" />
<cfargument name="generator" type="any" required="true" />

<cfscript>
request._simpleRequestCache = request._simpleRequestCache ?: {};
if ( !request._simpleRequestCache.keyExists( arguments.key ) ) {
request._simpleRequestCache[ arguments.key ] = arguments.generator();
}
return request._simpleRequestCache[ arguments.key ];
</cfscript>
</cffunction>
<cffunction name="getSingleton" access="public" returntype="any" output="false">
<cfargument name="objectName" type="string" required="true" />

<cfscript>
var args = arguments;
return simpleRequestCache( "getSingleton" & args.objectName, function(){
return getController().getWireBox().getInstance( args.objectName );
} );
</cfscript>
</cffunction>

0 comments on commit 717dfb9

Please sign in to comment.