@@ -50,7 +50,7 @@ class PSPDFKitView extends React.Component {
5050 } ;
5151
5252 _onDataReturned = event => {
53- let { requestId, result, error } = event . nativeEvent ;
53+ let { requestId, result, error} = event . nativeEvent ;
5454 let promise = this . _requestMap [ requestId ] ;
5555 if ( result ) {
5656 promise . resolve ( result ) ;
@@ -63,35 +63,35 @@ class PSPDFKitView extends React.Component {
6363 /**
6464 * Enters the annotation creation mode, showing the annotation creation toolbar.
6565 */
66- enterAnnotationCreationMode = function ( ) {
66+ enterAnnotationCreationMode ( ) {
6767 UIManager . dispatchViewManagerCommand (
6868 findNodeHandle ( this . refs . pdfView ) ,
6969 UIManager . RCTPSPDFKitView . Commands . enterAnnotationCreationMode ,
7070 [ ]
7171 ) ;
72- } ;
72+ }
7373
7474 /**
7575 * Exits the currently active mode, hiding all active sub-toolbars.
7676 */
77- exitCurrentlyActiveMode = function ( ) {
77+ exitCurrentlyActiveMode ( ) {
7878 UIManager . dispatchViewManagerCommand (
7979 findNodeHandle ( this . refs . pdfView ) ,
8080 UIManager . RCTPSPDFKitView . Commands . exitCurrentlyActiveMode ,
8181 [ ]
8282 ) ;
83- } ;
83+ }
8484
8585 /**
8686 * Saves the currently opened document.
8787 */
88- saveCurrentDocument = function ( ) {
88+ saveCurrentDocument ( ) {
8989 UIManager . dispatchViewManagerCommand (
9090 findNodeHandle ( this . refs . pdfView ) ,
9191 UIManager . RCTPSPDFKitView . Commands . saveCurrentDocument ,
9292 [ ]
9393 ) ;
94- } ;
94+ }
9595
9696 /**
9797 * Gets all annotations from a specific page.
@@ -101,13 +101,13 @@ class PSPDFKitView extends React.Component {
101101 * @returns a promise resolving an array with the following structure:
102102 * {'annotations' : [instantJson]}
103103 */
104- getAnnotations = function ( pageIndex ) {
104+ getAnnotations ( pageIndex ) {
105105 let requestId = this . _nextRequestId ++ ;
106106 let requestMap = this . _requestMap ;
107107
108108 // We create a promise here that will be resolved once onDataReturned is called.
109- let promise = new Promise ( function ( resolve , reject ) {
110- requestMap [ requestId ] = { resolve : resolve , reject : reject } ;
109+ let promise = new Promise ( ( resolve , reject ) => {
110+ requestMap [ requestId ] = { resolve : resolve , reject : reject } ;
111111 } ) ;
112112
113113 UIManager . dispatchViewManagerCommand (
@@ -117,34 +117,34 @@ class PSPDFKitView extends React.Component {
117117 ) ;
118118
119119 return promise ;
120- } ;
120+ }
121121
122122 /**
123123 * Adds a new annotation to the current document.
124124 *
125125 * @param annotation InstantJson of the annotation to add with the format of
126126 * https://pspdfkit.com/guides/windows/current/importing-exporting/instant-json/#instant-annotation-json-api
127127 */
128- addAnnotation = function ( annotation ) {
128+ addAnnotation ( annotation ) {
129129 UIManager . dispatchViewManagerCommand (
130130 findNodeHandle ( this . refs . pdfView ) ,
131131 UIManager . RCTPSPDFKitView . Commands . addAnnotation ,
132132 [ annotation ]
133133 ) ;
134- } ;
134+ }
135135
136136 /**
137137 * Gets toolbar items currently shown.
138138 *
139139 * @return Receives an array of https://pspdfkit.com/api/web/PSPDFKit.ToolbarItem.html.
140140 */
141- getToolbarItems = function ( ) {
141+ getToolbarItems ( ) {
142142 let requestId = this . _nextRequestId ++ ;
143143 let requestMap = this . _requestMap ;
144144
145145 // We create a promise here that will be resolved once onDataReturned is called.
146- let promise = new Promise ( function ( resolve , reject ) {
147- requestMap [ requestId ] = { resolve : resolve , reject : reject } ;
146+ let promise = new Promise ( ( resolve , reject ) => {
147+ requestMap [ requestId ] = { resolve : resolve , reject : reject } ;
148148 } ) ;
149149
150150 UIManager . dispatchViewManagerCommand (
@@ -154,7 +154,7 @@ class PSPDFKitView extends React.Component {
154154 ) ;
155155
156156 return promise ;
157- } ;
157+ }
158158
159159 /**
160160 * Set toolbar items currently shown.
@@ -165,13 +165,13 @@ class PSPDFKitView extends React.Component {
165165 * For more advance features please refer to
166166 * https://pspdfkit.com/guides/web/current/customizing-the-interface/customizing-the-toolbar/.
167167 */
168- setToolbarItems = function ( toolbarItems ) {
168+ setToolbarItems ( toolbarItems ) {
169169 let requestId = this . _nextRequestId ++ ;
170170 let requestMap = this . _requestMap ;
171171
172172 // We create a promise here that will be resolved once onDataReturned is called.
173- let promise = new Promise ( function ( resolve , reject ) {
174- requestMap [ requestId ] = { resolve : resolve , reject : reject } ;
173+ let promise = new Promise ( ( resolve , reject ) => {
174+ requestMap [ requestId ] = { resolve : resolve , reject : reject } ;
175175 } ) ;
176176
177177 UIManager . dispatchViewManagerCommand (
@@ -181,7 +181,7 @@ class PSPDFKitView extends React.Component {
181181 ) ;
182182
183183 return promise ;
184- } ;
184+ }
185185}
186186
187187PSPDFKitView . propTypes = {
0 commit comments