0.2.0 • Published 8 years ago

react-announce-hydrate v0.2.0

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

react-announce-hydrate Build Status npm semantic-release

Dispatches component lifecycle events to an observer. The same can also be done via @asStream but it require the use of getComponentStream() method. The @hydrate decorator helps us achieve this using a purely declarative approach.

Install

npm i react-announce-hydrate --save

Example

import {hydrate} from 'react-announce-hydrate'
import {Subject} from 'rx'
import {Component} from 'react'

const lifeCycleObserver = new Subject()

@hydrate(lifeCycleObserver)
class Name extends Component {
  render () {
    return (
      <div>Hello World!</div>
    )
  }
}

subject.subscribe(x => console.log(x.event))

/** OUTPUT:
 WILL_MOUNT
 DID_MOUNT
 ...
**/
0.2.0

8 years ago

0.1.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.2-0

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago