-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
This library is pretty useful as it is, but having the option to dynamically generate the script URLs based on props would make it more generic.
Example use case: you want to load an API library (say Google API) but want to dynamically inject the API_KEY based on config fetched from server, or logged in user permissions/profile, and so on.
Basically being able to do something like:
const Enhanced = AsyncScriptLoader(props => {
return [
'https://ajax.googleapis.com/ajax/libs/jquery/' +
props.version +
'/jquery.min.js'
]
})(MyComponent)
// later on
<MyComponent version='3.0.0' />
In addition this will make this library play much nicer with recompose
in which a stream of props is generated from HOC to HOC.
Pull request to follow :)
assafswix, bewestphal, dustinbrink, speedo-sp7, annshress and 2 more
Metadata
Metadata
Assignees
Labels
No labels