Crates.io | firebase-js |
lib.rs | firebase-js |
version | 0.0.1 |
source | src |
created_at | 2023-04-25 08:00:33.993333 |
updated_at | 2023-04-25 08:00:33.993333 |
description | High level interop with `npm`s `firebase@9` package for `wasm32-unknown-unknown` web targets. |
homepage | |
repository | https://github.com/ActuallyHappening/rust-firebase-js/tree/master/firebase-js |
max_upload_size | |
id | 848284 |
size | 9,765 |
npm:firebase@9
in Rust!This is a Rust port of the Firebase JS SDK. It is currently a work in progress, and is under heavy development.
I want to use Firebase, and 100% Rust. Therefore, being experienced with the JS SDK, this package tries to port the ease of use and simplicity of the JS SDK while not just using a custom HTTP implementation, having the full power of JavaScript at your fingertips!
This package tries to maintain the same modular structure of the Firebase JS SDK, while converting the APIs into Rust. Pure JS examples are given for each Rust function
(assuming secrets.rs file)
use firebase_js::{app::initialize_app, database::{get_database, on_value_changed, get_ref_of_root}};
use log::info;
use crate::secrets::URL;
mod secrets;
fn main() {
_ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once();
info!("firebase-js: main.rs()");
let app = initialize_app(&secrets::get_config()).ok().unwrap();
let db = get_database(&app, URL.to_string()).ok().unwrap();
let reference = get_ref_of_root(&db).ok().unwrap();
on_value_changed(&reference, &move |_| {
info!("RS: on_value_changed() WOW!")
})
}