Skip to content

Commit

Permalink
Fix use of this inside amplify-tests.ts (#44343)
Browse files Browse the repository at this point in the history
* Fix use of `this` inside amplify-tests.ts

The tests incorrectly use `this` inside an arrow function. This is
flagged as an error inside modules now, since `this` is supposed to be
`undefined`.

* fix space lint

* add newline
  • Loading branch information
sandersn committed Apr 29, 2020
1 parent 0504976 commit 9fb059a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion types/amplify/amplify-tests.ts
Expand Up @@ -28,7 +28,7 @@ amplify.publish("dataexample2", "bar", "baz");

// Subscribe and publish with context and data

amplify.subscribe("datacontextexample", $("p:first"), data => {
amplify.subscribe("datacontextexample", $("p:first"), function(data) {
this.text(data.exampleText); // first p element would have "foo bar baz" as text
});

Expand Down Expand Up @@ -243,6 +243,7 @@ amplify.request({
}
});
// Handling Status

// Status in Success and Error Callbacks

// amplify.request comes with built in support for status.The status parameter appears in the default success or error callbacks when using an ajax definition.
Expand Down

0 comments on commit 9fb059a

Please sign in to comment.