New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dat.fire

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dat.fire

Connecting Firebase to dat.gui for input beyond the mouse and keyboard.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

dat.fire

A simple way to connect your dat.gui controllers to a Firebase Realtime Database.

usage

// initialize dat.fire with an initialized firebase db
import DatFire from 'dat.fire'
import firebase from 'firebase'
firebase.initializeApp(config)
let datFire = new DatFire(firebase.database())

// create your dat.gui like normal (with or without folders)
let gui = new dat.GUI();
let guiSpeed = gui.add(settings, 'speed', 0, 3).listen();
let guiDieSpeed = gui.add(settings, 'dieSpeed', 0.0005, 0.05).listen();
...

// once all controllers are created, initialize dat.fire
datFire.init(gui)

// or only pass in the controllers you want to connect
datFire.init(gui, [guiSpeed, guiDieSpeed, ...])

// optionally add parameters for further simplicity
datFire.init(gui, null, { 'usePrevNext': true, 'simpleGui': true })

In that last example, notice that controllers array is null, which functions like the first line and automatically grabs all available controllers from dat.gui.

Once dat.fire has all the controllers, it will use its property string as the reference expected in the Firebase Database to handle value changes via a value event.

Google I/O

Check out the full setup at our Experiments Tent at Google I/O this year. All four components were open sourced.

[image from i/o setups]

The Android Experiment using Android Things is located here as well as a fork of The Spirit, a Chrome Experiment implementing dat.fire, located here

FAQs

Package last updated on 16 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts