Skip to contents

Check whether the current environment has the cached function named varname,if has, return it. if not, setup up a new cache function named varname.

Usage

mindat_cache_return_or_setup(varname,setupfun)

Arguments

varname

string.

setupfun

boolean, if the cached is a setup function.

Value

If the varname is found in current environment cache, return cached function. If not, eval the function and return cached function.

Examples

 aep<-  api_end_points<-mindat_cache_return_or_setup('api_end_points', function(){return (list()) })