Skip to content

Instantly share code, notes, and snippets.

@chris-feist
Last active September 11, 2018 21:35
Show Gist options
  • Save chris-feist/0bded3f5f683fec7f7248bb08650ddd8 to your computer and use it in GitHub Desktop.
Save chris-feist/0bded3f5f683fec7f7248bb08650ddd8 to your computer and use it in GitHub Desktop.
Sample source code for babel-plugin-testable
// @testable
const cache = {};
// @testable
function getKey(firstName, lastName) {
return `${firstName}_${lastName}`;
}
export const putUser = (user) => {
const key = getKey(user.firstName, user.lastName);
cache[key] = {
data: user,
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment