react-twitter-widgets
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -58,2 +58,3 @@ 'use strict'; | ||
var options = _props.options; | ||
var onLoad = _props.onLoad; | ||
@@ -65,2 +66,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done(); | ||
onLoad(); | ||
}); | ||
@@ -80,7 +82,9 @@ } | ||
username: _react2.default.PropTypes.string.isRequired, | ||
options: _react2.default.PropTypes.object | ||
options: _react2.default.PropTypes.object, | ||
onLoad: _react2.default.PropTypes.func | ||
}; | ||
Follow.defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: function onLoad() {} | ||
}; | ||
exports.default = Follow; |
@@ -58,2 +58,3 @@ 'use strict'; | ||
var options = _props.options; | ||
var onLoad = _props.onLoad; | ||
@@ -65,2 +66,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done(); | ||
onLoad(); | ||
}); | ||
@@ -80,7 +82,9 @@ } | ||
hashtag: _react2.default.PropTypes.string.isRequired, | ||
options: _react2.default.PropTypes.object | ||
options: _react2.default.PropTypes.object, | ||
onLoad: _react2.default.PropTypes.func | ||
}; | ||
Hashtag.defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: function onLoad() {} | ||
}; | ||
exports.default = Hashtag; |
@@ -58,2 +58,3 @@ 'use strict'; | ||
var options = _props.options; | ||
var onLoad = _props.onLoad; | ||
@@ -65,2 +66,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done(); | ||
onLoad(); | ||
}); | ||
@@ -80,7 +82,9 @@ } | ||
username: _react2.default.PropTypes.string.isRequired, | ||
options: _react2.default.PropTypes.object | ||
options: _react2.default.PropTypes.object, | ||
onLoad: _react2.default.PropTypes.func | ||
}; | ||
Mention.defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: function onLoad() {} | ||
}; | ||
exports.default = Mention; |
@@ -58,2 +58,3 @@ 'use strict'; | ||
var options = _props.options; | ||
var onLoad = _props.onLoad; | ||
@@ -65,2 +66,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done(); | ||
onLoad(); | ||
}); | ||
@@ -80,7 +82,9 @@ } | ||
url: _react2.default.PropTypes.string.isRequired, | ||
options: _react2.default.PropTypes.object | ||
options: _react2.default.PropTypes.object, | ||
onLoad: _react2.default.PropTypes.func | ||
}; | ||
Share.defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: function onLoad() {} | ||
}; | ||
exports.default = Share; |
@@ -58,2 +58,3 @@ 'use strict'; | ||
var options = _props.options; | ||
var onLoad = _props.onLoad; | ||
@@ -65,2 +66,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done(); | ||
onLoad(); | ||
}); | ||
@@ -80,7 +82,9 @@ } | ||
widgetId: _react2.default.PropTypes.string.isRequired, | ||
options: _react2.default.PropTypes.object | ||
options: _react2.default.PropTypes.object, | ||
onLoad: _react2.default.PropTypes.func | ||
}; | ||
Timeline.defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: function onLoad() {} | ||
}; | ||
exports.default = Timeline; |
@@ -58,2 +58,3 @@ 'use strict'; | ||
var options = _props.options; | ||
var onLoad = _props.onLoad; | ||
@@ -65,2 +66,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done(); | ||
onLoad(); | ||
}); | ||
@@ -80,7 +82,9 @@ } | ||
tweetId: _react2.default.PropTypes.string.isRequired, | ||
options: _react2.default.PropTypes.object | ||
options: _react2.default.PropTypes.object, | ||
onLoad: _react2.default.PropTypes.func | ||
}; | ||
Tweet.defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: function onLoad() {} | ||
}; | ||
exports.default = Tweet; |
{ | ||
"name": "react-twitter-widgets", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Twitter widgets as React components", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -28,2 +28,3 @@ # react-twitter-widgets | ||
}} | ||
onLoad={() => console.log('Timeline is loaded!')} | ||
/> | ||
@@ -49,2 +50,4 @@ ), document.getElementById('root')) | ||
All widgets accept an optional `onLoad` callback, which is called every time the widget is loaded/reloaded (both on inital load and updates). | ||
## Contributing | ||
@@ -51,0 +54,0 @@ |
@@ -9,7 +9,9 @@ import React from 'react' | ||
username: React.PropTypes.string.isRequired, | ||
options: React.PropTypes.object | ||
options: React.PropTypes.object, | ||
onLoad: React.PropTypes.func | ||
}; | ||
static defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: () => {} | ||
}; | ||
@@ -23,3 +25,3 @@ | ||
ready(tw, element, done) { | ||
const { username, options } = this.props | ||
const { username, options, onLoad } = this.props | ||
@@ -31,2 +33,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done() | ||
onLoad() | ||
}) | ||
@@ -33,0 +36,0 @@ } |
@@ -9,7 +9,9 @@ import React from 'react' | ||
hashtag: React.PropTypes.string.isRequired, | ||
options: React.PropTypes.object | ||
options: React.PropTypes.object, | ||
onLoad: React.PropTypes.func | ||
}; | ||
static defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: () => {} | ||
}; | ||
@@ -23,3 +25,3 @@ | ||
ready(tw, element, done) { | ||
const { hashtag, options } = this.props | ||
const { hashtag, options, onLoad } = this.props | ||
@@ -31,2 +33,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done() | ||
onLoad() | ||
}) | ||
@@ -33,0 +36,0 @@ } |
@@ -9,7 +9,9 @@ import React from 'react' | ||
username: React.PropTypes.string.isRequired, | ||
options: React.PropTypes.object | ||
options: React.PropTypes.object, | ||
onLoad: React.PropTypes.func | ||
}; | ||
static defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: () => {} | ||
}; | ||
@@ -23,3 +25,3 @@ | ||
ready(tw, element, done) { | ||
const { username, options } = this.props | ||
const { username, options, onLoad } = this.props | ||
@@ -31,2 +33,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done() | ||
onLoad() | ||
}) | ||
@@ -33,0 +36,0 @@ } |
@@ -9,7 +9,9 @@ import React from 'react' | ||
url: React.PropTypes.string.isRequired, | ||
options: React.PropTypes.object | ||
options: React.PropTypes.object, | ||
onLoad: React.PropTypes.func | ||
}; | ||
static defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: () => {} | ||
}; | ||
@@ -23,3 +25,3 @@ | ||
ready(tw, element, done) { | ||
const { url, options } = this.props | ||
const { url, options, onLoad } = this.props | ||
@@ -31,2 +33,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done() | ||
onLoad() | ||
}) | ||
@@ -33,0 +36,0 @@ } |
@@ -9,7 +9,9 @@ import React from 'react' | ||
widgetId: React.PropTypes.string.isRequired, | ||
options: React.PropTypes.object | ||
options: React.PropTypes.object, | ||
onLoad: React.PropTypes.func | ||
}; | ||
static defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: () => {} | ||
}; | ||
@@ -23,3 +25,3 @@ | ||
ready(tw, element, done) { | ||
const { widgetId, options } = this.props | ||
const { widgetId, options, onLoad } = this.props | ||
@@ -31,2 +33,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done() | ||
onLoad() | ||
}) | ||
@@ -33,0 +36,0 @@ } |
@@ -9,7 +9,9 @@ import React from 'react' | ||
tweetId: React.PropTypes.string.isRequired, | ||
options: React.PropTypes.object | ||
options: React.PropTypes.object, | ||
onLoad: React.PropTypes.func | ||
}; | ||
static defaultProps = { | ||
options: {} | ||
options: {}, | ||
onLoad: () => {} | ||
}; | ||
@@ -23,3 +25,3 @@ | ||
ready(tw, element, done) { | ||
const { tweetId, options } = this.props | ||
const { tweetId, options, onLoad } = this.props | ||
@@ -31,2 +33,3 @@ // Options must be cloned since Twitter Widgets modifies it directly | ||
done() | ||
onLoad() | ||
}) | ||
@@ -33,0 +36,0 @@ } |
37273
727
66