Skip to content

Commit 47cd292

Browse files
authored
Merge pull request #404 from ChartIQ/consolidate-listener-with-types
Consolidate Listener with other types in documentation
2 parents 343a68c + 8f39a87 commit 47cd292

11 files changed

Lines changed: 59 additions & 74 deletions

File tree

docs/api/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The focus of the FDC3 Standard Working Group has been to create a small but cons
2020
- [`window.fdc3`](ref/Globals#windowfdc3-object) global object and [`fdc3Ready`](ref/Globals#fdc3ready-event) event, for accessing FDC3 operations globally
2121
- [`DesktopAgent`](ref/DesktopAgent) interface, which exposes FDC3 operations
2222
- [`Channel`](ref/Channel) interface, for subscribing to specific context channels
23-
- [`Listener`](ref/Listener) interface, which allows unsubscribing intent or context listeners
23+
- [`Listener`](ref/Types#listener) interface, which allows unsubscribing intent or context listeners
2424

2525
## Usage
2626

docs/api/ref/Channel.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ interface Channel {
3333
#### See also
3434

3535
* [`Context`](Types#context)
36+
* [`Listener`](Types#listener)
3637
* [`DesktopAgent.getSystemChannels`](DesktopAgent#getsystemchannels)
3738
* [`DesktopAgent.getOrCreateChannel`](DesktopAgent#getorcreatechannel)
3839
* [`DesktopAgent.joinChannel`](DesktopAgent#joinchannel)
@@ -118,7 +119,7 @@ instrumentListener.unsubscribe();
118119
```
119120

120121
#### See also
121-
* [`Listener`](Listener)
122+
* [`Listener`](Types#listener)
122123
* [`ContextHandler`](Types#contexthandler)
123124
* [`broadcast`](#broadcast)
124125
* [`getCurrentContext`](#getcurrentcontext)

docs/api/ref/DesktopAgent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const contactListener = fdc3.addContextListener('fdc3.contact', contact => { ...
6868
```
6969

7070
#### See also
71-
* [`Listener`](Listener)
71+
* [`Listener`](Types#listener)
7272
* [`Context`](Types#context)
7373

7474

@@ -89,7 +89,7 @@ const listener = fdc3.addIntentListener('StartChat', context => {
8989
```
9090

9191
#### See also
92-
* [`Listener`](Listener)
92+
* [`Listener`](Types#listener)
9393
* [`Context`](Types#context)
9494

9595

docs/api/ref/Listener.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/api/ref/Types.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,30 @@ Used when attaching listeners for context broadcasts and raised intents.
4949
* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener)
5050
* [`Channel.addContextListener`](Channel#addcontextlistener)
5151

52+
## `Listener`
53+
54+
A Listener object is returned when an application subscribes to intents or context broadcasts via the [`addIntentListener`](#addintentlistener) or [`addContextListener`](#addcontextlistener) methods on the [DesktopAgent](DesktopAgent) object.
55+
56+
```typescript
57+
interface Listener {
58+
unsubscribe(): void;
59+
}
60+
```
61+
#### `unsubscribe`
62+
63+
```ts
64+
unsubscribe(): void;
65+
```
66+
67+
Allows an application to unsubscribe from listening to intents or context broadcasts.
68+
69+
#### See also
70+
* [`DesktopAgent.addIntentListener`](DesktopAgent#addintentlistener)
71+
* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener)
72+
* [`Channel.addContextListener`](Channel#addcontextlistener)
73+
* [`ContextHandler`](Types#contexthandler)
74+
75+
5276
## `TargetApp`
5377

5478
```typescript

website/versioned_docs/version-1.2/api/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The focus of the FDC3 Standard Working Group has been to create a small but cons
2121
- [`window.fdc3`](ref/Globals#windowfdc3-object) global object and [`fdc3Ready`](ref/Globals#fdc3ready-event) event, for accessing FDC3 operations globally
2222
- [`DesktopAgent`](ref/DesktopAgent) interface, which exposes FDC3 operations
2323
- [`Channel`](ref/Channel) interface, for subscribing to specific context channels
24-
- [`Listener`](ref/Listener) interface, which allows unsubscribing intent or context listeners
24+
- [`Listener`](ref/Types#listener) interface, which allows unsubscribing intent or context listeners
2525

2626
## Usage
2727

website/versioned_docs/version-1.2/api/ref/Channel.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ interface Channel {
3434
#### See also
3535

3636
* [`Context`](Types#context)
37+
* [`Listener`](Types#listener)
3738
* [`DesktopAgent.getSystemChannels`](DesktopAgent#getsystemchannels)
3839
* [`DesktopAgent.getOrCreateChannel`](DesktopAgent#getorcreatechannel)
3940
* [`DesktopAgent.joinChannel`](DesktopAgent#joinchannel)
@@ -119,7 +120,7 @@ instrumentListener.unsubscribe();
119120
```
120121

121122
#### See also
122-
* [`Listener`](Listener)
123+
* [`Listener`](Types#listener)
123124
* [`ContextHandler`](Types#contexthandler)
124125
* [`broadcast`](#broadcast)
125126
* [`getCurrentContext`](#getcurrentcontext)
@@ -198,5 +199,4 @@ try {
198199
#### See also
199200
* [`ChannelError`](Errors#channelerror)
200201
* [`broadcast`](#broadcast)
201-
* [`addContextListener`](#addcontextlistener)
202-
202+
* [`addContextListener`](#addcontextlistener)

website/versioned_docs/version-1.2/api/ref/DesktopAgent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const contactListener = fdc3.addContextListener('fdc3.contact', contact => { ...
6969
```
7070

7171
#### See also
72-
* [`Listener`](Listener)
72+
* [`Listener`](Types#listener)
7373
* [`Context`](Types#context)
7474

7575

@@ -90,7 +90,7 @@ const listener = fdc3.addIntentListener('StartChat', context => {
9090
```
9191

9292
#### See also
93-
* [`Listener`](Listener)
93+
* [`Listener`](Types#listener)
9494
* [`Context`](Types#context)
9595

9696

website/versioned_docs/version-1.2/api/ref/Listener.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

website/versioned_docs/version-1.2/api/ref/Types.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,30 @@ Used when attaching listeners for context broadcasts and raised intents.
5151
* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener)
5252
* [`Channel.addContextListener`](Channel#addcontextlistener)
5353

54+
## `Listener`
55+
56+
A Listener object is returned when an application subscribes to intents or context broadcasts via the [`addIntentListener`](#addintentlistener) or [`addContextListener`](#addcontextlistener) methods on the [DesktopAgent](DesktopAgent) object.
57+
58+
```typescript
59+
interface Listener {
60+
unsubscribe(): void;
61+
}
62+
```
63+
#### `unsubscribe`
64+
65+
```ts
66+
unsubscribe(): void;
67+
```
68+
69+
Allows an application to unsubscribe from listening to intents or context broadcasts.
70+
71+
#### See also
72+
* [`DesktopAgent.addIntentListener`](DesktopAgent#addintentlistener)
73+
* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener)
74+
* [`Channel.addContextListener`](Channel#addcontextlistener)
75+
* [`ContextHandler`](Types#contexthandler)
76+
77+
5478
## `TargetApp`
5579

5680
```typescript

0 commit comments

Comments
 (0)