Skip to content

Instantly share code, notes, and snippets.

@unamashana
Created December 26, 2013 09:30
Show Gist options
  • Save unamashana/8131663 to your computer and use it in GitHub Desktop.
Save unamashana/8131663 to your computer and use it in GitHub Desktop.
SB.Utils.getfromCache = (key, fn) ->
object = Backbone.CacheStore.get(key)
if !object?
object = fn.apply(this)
Backbone.CacheStore.set(key, object)
object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment