Skip to content

Instantly share code, notes, and snippets.

@bobbravo2
Created August 6, 2016 15:15
Show Gist options
  • Save bobbravo2/f21325e3b8696b286cf42757c9d26084 to your computer and use it in GitHub Desktop.
Save bobbravo2/f21325e3b8696b286cf42757c9d26084 to your computer and use it in GitHub Desktop.
// Initialize Firebase (YOUR OWN APP)
// Set Initial Counter
var initialValue = 100;
var clickCounter = initialValue;
// --------------------------------------------------------------
// At the initial load, get a snapshot of the current data.
// Print the initial data to the console.
// Change the html to reflect the initial value.
// Change the clickcounter to match the data in the database
// Log the value of the clickCounter
// Change the HTML Value
// If any errors are experienced, log them to console.
// --------------------------------------------------------------
// Whenever a user clicks the click button
$("#clickButton").on("click", function() {
// Reduce the clickCounter by 1
// Alert User and reset the counter
// Save new value to Firebase
// Log the value of clickCounter
});
// Whenever a user clicks the restart button
$("#restartButton").on("click", function() {
// Set the clickCounter back to initialValue
// Save new value to Firebase
// Log the value of clickCounter
// Change the HTML Values
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment