react-gpt icon indicating copy to clipboard operation
react-gpt copied to clipboard

Expose onScriptRequestStarted and onScriptError callbacks via props

Open AlexisGlez opened this issue 8 years ago • 0 comments

Description

It would be cool and really helpful if the Bling component can receive the props onScriptRequestStarted and onScriptError so the users can get these callbacks in their application.

Use Case Example

If we wrap this component with another one to display a progress bar while the ad is being requested, we can simplify the logic in our application to replace the progress bar with another thing if an error occurred.

Implementation Suggestion

The implementation for this would be really simple, in the Bling's componentDidMount we would call this.props.onScriptRequestStarted() method and in the function onScriptError we would call this.props.onScriptError()

Note: Maybe the callbacks can have a different name 😄

AlexisGlez avatar Sep 05 '18 22:09 AlexisGlez