Skip to content

Instantly share code, notes, and snippets.

View gamebusterz's full-sized avatar
🍞

Sailesh Choyal gamebusterz

🍞
View GitHub Profile
@gamebusterz
gamebusterz / firebase_detect_data.js
Created December 21, 2016 16:37 — forked from anantn/firebase_detect_data.js
Firebase: Detecting if data exists. This snippet detects if a user ID is already taken
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');