fix readme issues
This commit is contained in:
@@ -21,7 +21,7 @@ _The included demo React app for Google Sheets shows insertion, deletion and sel
|
|||||||
```
|
```
|
||||||
2. Enable the Google Apps Script API for your account by visiting[(script.google.com/home/usersettings)](https://script.google.com/home/usersettings):
|
2. Enable the Google Apps Script API for your account by visiting[(script.google.com/home/usersettings)](https://script.google.com/home/usersettings):
|
||||||
|
|
||||||

|
<img width="215" height="82" src="https://i.imgur.com/vuwkzMU.png">
|
||||||
|
|
||||||
3. Log in to `clasp`:
|
3. Log in to `clasp`:
|
||||||
```bash
|
```bash
|
||||||
@@ -84,37 +84,34 @@ Insert/activate/delete sheets through a simple HTML dialog, built with React. Ac
|
|||||||
.withSuccessHandler(response => doSomething(response))
|
.withSuccessHandler(response => doSomething(response))
|
||||||
.withFailureHandler(err => handleError(err))
|
.withFailureHandler(err => handleError(err))
|
||||||
.addSheet(sheetTitle);
|
.addSheet(sheetTitle);
|
||||||
|
|
||||||
|
// Poof! With a little magic we can now do this:
|
||||||
|
import server from '../server';
|
||||||
|
|
||||||
|
// We now have access to all our server functions, which return promises!
|
||||||
|
const { addSheet } = server;
|
||||||
|
addSheet(sheetTitle)
|
||||||
|
.then(response => doSomething(response))
|
||||||
|
.catch(handleError(err));
|
||||||
|
|
||||||
|
// Or we can use async/await:
|
||||||
|
async () => {
|
||||||
|
try {
|
||||||
|
const response = await addSheet(sheetTitle);
|
||||||
|
doSomething(response);
|
||||||
|
} catch (err) {
|
||||||
|
handleError(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Now we can use familiar Promises in our client-side code and have easy access to all server functions. See [the code](./src/client/server.js) for the implementation details.
|
||||||
|
|
||||||
// Poof! With a little magic we can now do this:
|
- This project includes support for autocompletion and complete type definitions for all Google Apps Script methods.
|
||||||
import server from '../server';
|
|
||||||
|
|
||||||
// We now have access to all our server functions, which return promises!
|

|
||||||
const { addSheet } = server;
|
|
||||||
addSheet(sheetTitle)
|
|
||||||
.then(response => doSomething(response))
|
|
||||||
.catch(handleError(err));
|
|
||||||
|
|
||||||
// Or we can use async/await:
|
- All available methods from the Google Apps Script API are shown with full definitions and links to the official documentation, plus information on argument and return type
|
||||||
async () => {
|
|
||||||
try {
|
|
||||||
const response = await addSheet(sheetTitle);
|
|
||||||
doSomething(response);
|
|
||||||
} catch (err) {
|
|
||||||
handleError(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
````
|
|
||||||
Now we can use familiar Promises in our client-side code and have easy access to all server functions. See [the code](./src/client/server.js) for the implementation details.
|
|
||||||
|
|
||||||
## Full Autocompletion
|
|
||||||
This project includes support for autocompletion and complete type definitions for all Google Apps Script methods.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
- Lists all available methods from the appropriate Google Apps Script API
|
|
||||||
- Full definitions with links to official documentation, plus information on argument and return type
|
|
||||||
|
|
||||||
|
|
||||||
## Extending this app
|
## Extending this app
|
||||||
@@ -138,7 +135,7 @@ const onOpen = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
global.onOpen = onOpen
|
global.onOpen = onOpen
|
||||||
````
|
```
|
||||||
|
|
||||||
## Multiple dialogs
|
## Multiple dialogs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user