Skip to content

Instantly share code, notes, and snippets.

@danscan
Created January 25, 2016 16:55
Policy function
const db = {
usersBySessionToken: {
'1': {
id: 1,
name: 'Dan',
},
},
postsById: {
'2': {
id: 2,
author: 1,
body: 'hey',
},
},
getRequestUser(sessionToken) {
return this.usersBySessionToken[sessionToken];
},
getPost(postId) {
return this.postsById[postId];
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment