Skip to content

Instantly share code, notes, and snippets.

@MeyCry
Created January 29, 2016 14:34
Show Gist options
  • Save MeyCry/5a81655eabd0d590e745 to your computer and use it in GitHub Desktop.
Save MeyCry/5a81655eabd0d590e745 to your computer and use it in GitHub Desktop.
_appsHash = {}
_appsArr = []
getAll = -> _appsArr
getAppById = (appId) -> _appsHash[appId]
_fetch = (apps) ->
appsHash = {}
_appsArr = apps.map (item) ->
appsHash[item.id] = _appsHash[item.id] or assign({}, item)
_appsHash = appsHash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment