Skip to content

Instantly share code, notes, and snippets.

View markmarijnissen's full-sized avatar

Mark Marijnissen markmarijnissen

View GitHub Profile
@markmarijnissen
markmarijnissen / data.md
Last active August 29, 2015 14:16 — forked from dtheodor/data.md

Problem:

  • There's a module that knows how to load (and re-load) data through an API, and stores it locally.
  • Multiple modules access the loaded data, and transform them into a different representation (each module does a different transform), also storing them locally
  • The transformed data is exposed to the view, with a 'loading' indication when the original data is (re)loaded and/or the transformation is in progress.

##API idea

Promises support:

  • on resolution callbacks, where the transform function can be attached.
  • a isResolved attribute, which is false when the promise has been started but not yet resolved.