Skip to content

Commit

Permalink
fix(collapsable): fix error: d.collapsable is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Feb 22, 2016
1 parent ca063ad commit 0719dbb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/collapsable.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const createDeclarative = require('react-announce').createDeclarative

const e = module.exports = (d, ReactDOM, window) => createDeclarative(
function (stream, dispose) {
dispose(d.collapsable(d, ReactDOM, window, stream))
dispose(d.init(d, ReactDOM, window, stream))
}
)()
)()

e.init = (d, ReactDOM, window, stream) => {
const s = d.getSourceStreams(ReactDOM, window, stream)
Expand Down
12 changes: 9 additions & 3 deletions test/test.collapsable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ const testObserver = s => {
}

test(t => {
const mock = x => x
const out = e({collapsable: x => null }, 'react-dom', 'window')(mock)
t.is(out, mock)
class Mock {
componentWillMount () {

}
}
const out = e({init: x => null }, 'react-dom', 'window')(Mock)
const m = new Mock()
m.componentWillMount()
t.is(out, Mock)
})

test('init', t => {
Expand Down

0 comments on commit 0719dbb

Please sign in to comment.