Skip to content

Commit

Permalink
Add a utility function to look up a model by type and ID
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Nov 8, 2017
1 parent d93f3a0 commit cbf7fc3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/common/utils/modelUtils.js
@@ -0,0 +1,5 @@
export function getModelByType(session, itemType, itemID) {
const modelClass = session[itemType];
const model = modelClass.withId(itemID);
return model;
}

0 comments on commit cbf7fc3

Please sign in to comment.