Try it: click here
In the commands below, yarn is the tool of choice. If you want to use npm, just replace
yarn
bynpm
in the commands.
cd UploadCare
- Install dependencies:
yarn
- Start Fable daemon and Webpack dev server:
yarn start
- In your browser, open: http://localhost:8084/
- Add dependency:
yarn add uploadcare-widget
- Grab the
src/UploadCarecomponent.fs
file and add it to your project.
let inline UploadCare props = ofType<UploadCareComponent.Input,_,_> props []
UploadCare
{
value=""
onChange=(fun _ -> printfn "onChange")
onUploadComplete=(fun info -> printfn "%s" info.cdnUrl)
}
<script>
UPLOADCARE_PUBLIC_KEY = 'demopublickey'; // change to your private key
</script>
Just have a look at src/App.fs
to see a complete sample
The whole UploadCare API has not been handled in this project. It's merely a simple sample you can then change according to your needs.
So fork this project or send a PR if you wish to add more bindings.
Thanks to @vbfox for his great React to fable tutorials!