completeGoal() { const { email } = this.props.user; const { title, serverKey } = this.props.goal; goalRef.child(serverKey).remove(); completeGoalRef.push({email, title}); }
constructor(props) { super(props) this.state = { rooms: null, isLoaded: false, } this.roomRef = firebase.database().ref().child('rooms') }
const removeDestination = (destinationId) => { return database.ref(getActualUserUri()) .child('destinations/' + destinationId) .remove(); }
constructor(props) { super(props); this.addNote = this.addNote.bind(this); this.removeNote = this.removeNote.bind(this); // 1. connect to firebase this.app = firebase.initializeApp(fire_config); this.database = this.app.database().ref().child('notes'); this.state = { notes: [] } }
export function addItem(title) { const id = Math.random().toString(36).substring(7) const itemRef = itemsRef.child('e5d65252-21c8-4030-951f-8a441d886740'); itemRef.set({ id, title: title, time: new Date().getTime() }) return { type: ADD_ITEM } }
constructor(props) { super(props); this.state = { messages: [] }; this.user = firebase.auth().currentUser this.friend = this.props.friend this.chatRef = this.getRef().child('chat/' + this.generateChatId()); this.chatRefData = this.chatRef.orderByChild('order') this.onSend = this.onSend.bind(this); }
constructor(props) { super(props); this.state = { dataSource: new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2, }), loading: true }; this.friendsRef = this.getRef().child('friends'); navigator = this.props.navigator }
db.once('value',function(snap){ snap.forEach(function(childsnap){ var key = childsnap.key; var ref = db.child(key); ref.update({ "images" : "Yayyy" }); }); });
const swapPositionUpDestination = (selected, selectedUp) => { const updatedObjects = {}; updatedObjects[selected.id + orderUri] = selectedUp.order; updatedObjects[selectedUp.id + orderUri] = selected.order; return database.ref(getActualUserUri()) .child('destinations') .update(updatedObjects); }
constructor(props) { super(props) this.state = { message: '', messages: null, isLoaded: false, isKeyboardActive: false, } this.messagesRef = firebase.database().ref().child('rooms/' + this.props.room._key + '/messages') }