2.1.2 • Published 8 years ago

endothermic v2.1.2

Weekly downloads
5
License
ISC
Repository
github
Last release
8 years ago

Endothermic!

A small util to bind react components to firebase listeners, because reactfire is too imperative for me 😜

Features

  • Declarative decorator syntax
  • Automatic binding/unbinding
  • Support for nesting

Quick Start

$ npm install --save endothermic

Now, recommended at the top component of you app, you wrap it in a <Provider /> tag

import Firebase from 'firebase'
import {Provider} from 'endothermic'
import React from 'react'

import MyComponent from './MyComponent'

let FIREBASE_URL = '...'
let firebase = new Firebase(FIREBASE_URL)

export default class App extends React.Component {
  render() {
    return (
      <Provider firebase={firebase} />
        <MyComponent />
      </Provider>
    )
  }
}

Now, in the files with the component you want to connect to firebase, you can do

import React from 'react'
import {connect} from 'endothermic'

@connect({
  name: 'users/jake/fullname'
})
class MyComponent extends React.Component {
  render() {
    let {name} = this.props
    return <p>Hello {name}</p>
  }
}

Api and examples

See API

Yet to come

  • Provider like syntax In version 2!
  • React-redux like second argument with side effects
  • Support for more advanced firebase queries
3.0.0

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago