File tree Expand file tree Collapse file tree 4 files changed +36
-6
lines changed Expand file tree Collapse file tree 4 files changed +36
-6
lines changed Original file line number Diff line number Diff line change 2020 - name : Build
2121 run : pnpm build
2222
23- - uses : actions/setup-node@v1
23+ - uses : actions/setup-node@v2
2424 with :
25- node-version : 12
25+ node-version : 14
2626 registry-url : https://registry.npmjs.org/
2727
2828 - run : npm publish
@@ -40,13 +40,14 @@ jobs:
4040 with :
4141 version : 6.6.2
4242 run_install : true
43+ registry : https://npm.pkg.github.com
4344
4445 - name : Build
4546 run : pnpm build
4647
47- - uses : actions/setup-node@v1
48+ - uses : actions/setup-node@v2
4849 with :
49- node-version : 12
50+ node-version : 14
5051 registry-url : https://npm.pkg.github.com
5152
5253 - run : npm publish
Original file line number Diff line number Diff line change @@ -38,6 +38,35 @@ const example = async () => {
3838example ();
3939```
4040
41+ ### Browser Examples
42+
43+ ``` html
44+ <!DOCTYPE html>
45+ <html >
46+ <head >
47+ <
script src =
" https://cdn.jsdelivr.net/npm/[email protected] " ></
script >
48+ </head >
49+ <body >
50+
51+ <h1 >Exemplo</h1 >
52+
53+ <script >
54+ document .addEventListener (' DOMContentLoaded' , function loaded () {
55+
56+ const example = async () => {
57+ const promise = new Promise ((resolve ) => resolve (' exemple' ));
58+
59+ const result = await usingTryCatch (promise);
60+ console .log (result .data ); // 'example'
61+ };
62+
63+ example ();
64+ });
65+ </script >
66+ </body >
67+ </html >
68+ ```
69+
4170
4271### NPM Statistics
4372
Original file line number Diff line number Diff line change 11{
2- "version" : " 0.1.1 " ,
2+ "version" : " 0.1.2 " ,
33 "license" : " MIT" ,
44 "name" : " using-try-catch" ,
55 "module" : " dist/esm/index.js" ,
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import cleanup from 'rollup-plugin-cleanup';
44export default {
55 input : 'src/index.ts' ,
66 output : {
7- name : 'using-try-catch ' ,
7+ name : 'usingTryCatch ' ,
88 dir : 'dist' ,
99 format : 'umd' ,
1010 sourcemap : true
You can’t perform that action at this time.
0 commit comments