Could you describe what you are trying to accomplish a little less abstractly?
Why is the outer function called? Where is the outer function? On a component? Why are you executing some action while trying to read a value of the function?