Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDC3 ready event - Issue 241 #269

Merged
merged 2 commits into from
Nov 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion docs/api/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,23 @@ Other interfaces defined in the spec are not critical to define as concrete type
- `DisplayMetadata`



#### API Access
The FDC3 API can be made available to an application through a number of different methods. In the case of web applications, a Desktop Agent SHOULD provide the FDC3 API via a global accessible as _window.fdc3_. Implementors MAY additionally make the API available through modules, imports, or other means.

The global `window.fdc3` must only be available after the API is ready to use. To prevent the API from being used before it is ready, implementors SHOULD provide a global `fdc3Ready` event. Here is code demonstrating the use of the FDC3 API and the ready event:

```js
function fdc3Stuff() {
// Make some fdc3 API calls here
}

if (window.fdc3) {
fdc3Stuff();
} else {
window.addEventListener("fdc3Ready", fdc3Stuff);
}
```

rikoe marked this conversation as resolved.
Show resolved Hide resolved
#### Standards vs. Implementation
![Desktop Agent - Standards Schematic](assets/api-1.png)

Expand Down