Set Realtime Database
javascriptCopy codeconst setRealtimeData = (path, data) => {
const dbRef = ref(db, path);
set(dbRef, data)
.then(() => {
console.log('Data berhasil disimpan.');
})
.catch((error) => {
console.error('Terjadi kesalahan:', error);
});
};
// Contoh pemanggilan
setRealtimeData('users/user1', {
name: 'John Doe',
email: '[email protected]'
});Last updated