Skip to content

Commit 1e00f6f

Browse files
dejanbjcrossley3
authored andcommitted
Update reqwest wasm example so it compiles and run properly again
Signed-off-by: Dejan Bosanac <[email protected]>
1 parent 0aeebac commit 1e00f6f

File tree

6 files changed

+7996
-51
lines changed

6 files changed

+7996
-51
lines changed

example-projects/reqwest-wasm-example/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ crate-type = ["cdylib"]
1111

1212
[dependencies]
1313
reqwest = "^0.11"
14+
uuid = "0.8"
1415
cloudevents-sdk = { path = "../..", features = ["reqwest"] }
1516
url = { version = "^2.1" }
1617
web-sys = { version = "0.3.39", features = ["Window", "Location"] }
1718
wasm-bindgen-futures = "0.4.12"
18-
wasm-bindgen = { version = "0.2.62", features = ["serde-serialize"] }
19+
wasm-bindgen = { version = "0.2.77", features = ["serde-serialize"] }

example-projects/reqwest-wasm-example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Then build the example locally with:
1010

1111
and then visiting http://localhost:8080 in a browser should run the example!
1212

13-
This example is loosely based off of [this example](https://github.com/rustwasm/wasm-bindgen/blob/master/examples/fetch/src/lib.rs), an example usage of `fetch` from `wasm-bindgen`, and from [reqwest repo](https://github.com/seanmonstar/reqwest/tree/master/examples/wasm_header).
13+
This example is loosely based off of [this example](https://github.com/rustwasm/wasm-bindgen/blob/master/examples/fetch/src/lib.rs), an example usage of `fetch` from `wasm-bindgen`, and from [reqwest repo](https://github.com/seanmonstar/reqwest/tree/master/examples/wasm_github_fetch).

example-projects/reqwest-wasm-example/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import 'bootstrap';
44
import 'bootstrap/dist/css/bootstrap.min.css';
55

66
import("./pkg").then(rustModule => {
7-
$(document).ready(function () {
8-
$("#send").click(function () {
7+
$(function() {
8+
$("#send").on("click", function () {
99
let target = $("#event_target").val()
1010
let ty = $("#event_type").val()
1111
let dataContentType = $("#event_datacontenttype").val()

0 commit comments

Comments
 (0)