We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a282a00 commit df092a5Copy full SHA for df092a5
1 file changed
src/containers/Write.js
@@ -1,6 +1,29 @@
1
import React from 'react';
2
3
const Write = () => {
4
+
5
+ const onWrite = async() => {
6
+ const abortController = new AbortController();
7
+ abortController.signal.onabort = event => {
8
+ alert('STOP');
9
+ };
10
+ try {
11
+ const ndef = new window.NDEFReader();
12
+ await ndef.write(
13
+ {
14
+ records: [{ recordType: "text", data: "17" }]
15
+ },
16
+ {signal: abortController.signal}
17
+ );
18
+ alert(`${16} saved!`);
19
+ abortController.abort();
20
+ } catch (error) {
21
+ console.log(error);
22
23
+ }
24
25
26
+ onWrite();
27
return (
28
"Write"
29
);
0 commit comments