Skip to content

Add 'once' to subscription options #270

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

Closed
wants to merge 2 commits into from
Closed
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
37 changes: 35 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1018,11 +1018,11 @@ <h2>The <dfn>ConsumedThing</dfn> interface</h2>
Promise&lt;Subscription&gt; observeProperty(DOMString name,
InteractionListener listener,
optional ErrorListener onerror,
optional InteractionOptions options = null);
optional SubscriptionOptions options = null);
Promise&lt;Subscription&gt; subscribeEvent(DOMString name,
InteractionListener listener,
optional ErrorListener onerror,
optional InteractionOptions options = null);
optional SubscriptionOptions options = null);
ThingDescription getThingDescription();
};

Expand All @@ -1032,6 +1032,10 @@ <h2>The <dfn>ConsumedThing</dfn> interface</h2>
any data;
};

dictionary SubscriptionOptions: InteractionOptions{
boolean once = false;
};

[SecureContext, Exposed=(Window,Worker)]
interface Subscription {
readonly attribute boolean active;
Expand Down Expand Up @@ -1488,6 +1492,10 @@ <h3>The <dfn>observeProperty()</dfn> method</h3>
<li>
Invoke |listener| with |reply|.
</li>
<li>
If |options|' |once| is `true`, invoke |subscription|'s
<a href="#the-stop-method">stop()</a> method with |options|.
</li>
</ul>
</li>
<li>
Expand All @@ -1505,6 +1513,10 @@ <h3>The <dfn>observeProperty()</dfn> method</h3>
<li>
If |onerror| is a {{Function}}, invoke it with |error|.
</li>
<li>
If |options|' |once| is `true`, invoke |subscription|'s
<a href="#the-stop-method">stop()</a> method with |options|.
</li>
</ul>
</li>
</ol>
Expand Down Expand Up @@ -1635,6 +1647,10 @@ <h3>The <dfn>subscribeEvent()</dfn> method</h3>
<a>parse interaction response</a> on the data provided with the
<a>Event</a>, [[\form]] and [[\interaction]].
</li>
<li>
If |options|' |once| is `true`, invoke |subscription|'s
<a href="#the-stop-method">stop()</a> method with |options|.
</li>
</ol>
</li>
<li>
Expand All @@ -1652,6 +1668,10 @@ <h3>The <dfn>subscribeEvent()</dfn> method</h3>
<li>
If |onerror| is a {{Function}}, invoke it with |error|.
</li>
<li>
If |options|' |once| is `true`, invoke |subscription|'s
<a href="#the-stop-method">stop()</a> method with |options|.
</li>
</ul>
</li>
</ol>
Expand Down Expand Up @@ -1695,6 +1715,19 @@ <h3>
</p>
</section>

<section data-dfn-for="InteractionOptions">
<h3>
The <dfn>SubscriptionOptions</dfn> dictionary
</h3>
<p>
Extends <a>InteractionOptions</a> for subscriptions.
</p>
<p>
The <dfn>once</dfn> property if not defined, takes the value `false`. If defined as `true`, will cause stopping the
subscription after the first notification.
</p>
</section>

<section>
<h3>The <dfn>PropertyMap</dfn> type</h3>
<p>
Expand Down