File tree Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change 11# react-dymo
22
3- > Collections of react hooks to handle the Dymo LabelWriter web service.
3+ > Collections of javascript and react utilities to handle the Dymo LabelWriter web service.
44
55[ ![ NPM] ( https://img.shields.io/npm/v/react-dymo-hooks.svg )] ( https://www.npmjs.com/package/react-dymo-hooks ) [ ![ JavaScript Style Guide] ( https://img.shields.io/badge/code_style-standard-brightgreen.svg )] ( https://standardjs.com )
66
@@ -74,10 +74,34 @@ Object containing:
74742 . ` yarn install ` or ` npm install `
75753 . ` yarn run start ` or ` npm run-script start `
7676
77- ### Example
77+ ## Examples
78+
79+ ### Print a Dymo Label
80+
81+ ``` jsx
82+ import {dymoRequestBuilder } from " react-dymo-hooks" ;
83+
84+ const params = {
85+ data: ` printerName=${ encodeURIComponent (printerSelected)} &printParamsXml=&labelXml=${ encodeURIComponent (
86+ xml
87+ )} &labelSetXml=` ,
88+ };
89+
90+ function handlePrintLabel () {
91+ dymoRequestBuilder ({
92+ method: " POST" ,
93+ wsAction: " printLabel" ,
94+ axiosOtherParams: params,
95+ })
96+ .then (() => {})
97+ .catch (() => {});
98+ }
99+
100+ < button onClick= {handlePrintLabel} / > ;
101+ ```
78102
79103``` jsx
80- import {useDymoOpenLabel , useDymoCheckService } from " react-hooks-toolbox " ;
104+ import {useDymoOpenLabel , useDymoCheckService } from " react-dymo-hooks " ;
81105
82106const DymoLabelPreview = () => {
83107 const statusDymoService = useDymoCheckService ();
You can’t perform that action at this time.
0 commit comments