Skip to content

Instantly share code, notes, and snippets.

@katelynsills
Created January 24, 2019 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katelynsills/a1cb92d0b59195adbdc01afc3327e512 to your computer and use it in GitHub Desktop.
Save katelynsills/a1cb92d0b59195adbdc01afc3327e512 to your computer and use it in GitHub Desktop.
We use a promise in our finance listener
const financeListener = {
stateChanged(state) {
if (state < 4000) {
Promise.resolve(bankAccount).then(ba => ba.deposit(1000));
}
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment