Skip to content

Instantly share code, notes, and snippets.

@bmeck
Created May 31, 2015 01:27
Show Gist options
  • Select an option

  • Save bmeck/55c7d09d2ca976fb2c64 to your computer and use it in GitHub Desktop.

Select an option

Save bmeck/55c7d09d2ca976fb2c64 to your computer and use it in GitHub Desktop.
function f() {
// put const here to make sure no teammate accidentally changes the ref
const needs_to_stay_same_ref = {};
// something like a setInterval to check on the status of an object
persistently_cached_arg_fn(needs_to_stay_same_ref);
// expose something the outside world could change
return needs_to_stay_same_ref;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment