Skip to content

Commit 822fdaa

Browse files
committed
docs: add new js client hints
1 parent 37a46a6 commit 822fdaa

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

docs/new_endpoint_tutorial.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,29 @@ Here's what we add to each client:
8282

8383
- [`delphi_epidata.js`](../src/client/delphi_epidata.js)
8484
```javascript
85-
// TODO sam
86-
Epidata.fluview_meta = function(callback) {
87-
var params;
88-
params = {
89-
'endpoint': 'fluview_meta'
90-
};
91-
return _request(callback, params);
85+
// within createEpidataAsync
86+
return {
87+
BASE_URL: baseUrl || BASE_URL,
88+
//...
89+
/**
90+
* Fetch FluView metadata
91+
*/
92+
fluview_meta: () => {
93+
return _request("fluview_meta", {});
94+
},
9295
};
9396
```
9497

9598
- [`delphi_epidata.d.ts`](../src/client/delphi_epidata.d.ts)
9699
```typescript
97-
// TODO sam
98-
Epidata.fluview_meta = function(callback) {
99-
var params;
100-
params = {
101-
'endpoint': 'fluview_meta'
102-
};
103-
return _request(callback, params);
104-
};
100+
export interface EpidataFunctions {
101+
// ...
102+
fluview_meta(callback: EpiDataCallback): Promise<EpiDataResponse>;
103+
}
104+
export interface EpidataAsyncFunctions {
105+
// ...
106+
fluview_meta(): Promise<EpiDataResponse>;
107+
}
105108
```
106109

107110
- [`delphi_epidata.py`](../src/client/delphi_epidata.py)

0 commit comments

Comments
 (0)