Skip to content
This repository was archived by the owner on Oct 24, 2021. It is now read-only.

Commit 0703076

Browse files
committed
Add example of usage for publication strategies
1 parent be14857 commit 0703076

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

source/api/pubsub.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ This allows us to only send deltas over multiple publications.
274274

275275
#### NO_MERGE_NO_HISTORY
276276
The `NO_MERGE_NO_HISTORY` strategy results in the server sending all publication data directly to the client.
277-
It does not remember what it has previously sent to it will not trigger removed messages when a subscription is stopped.
277+
It does not remember what it has previously sent to client and will not trigger removed messages when a subscription is stopped.
278278
This should only be chosen for special use cases like send-and-forget queues.
279279

280280
#### NO_MERGE
@@ -301,4 +301,11 @@ You can use the following methods to set or get the publication strategy for pub
301301

302302
{% apibox "setPublicationStrategy" %}
303303

304+
For publication `foo`, you can set `NO_MERGE` strategy as shown:
305+
306+
```js
307+
import { DDPServer } from "meteor/ddp-server";
308+
Meteor.server.setPublicationStrategy('foo', DDPServer.publicationStrategies.NO_MERGE);
309+
```
310+
304311
{% apibox "getPublicationStrategy" %}

0 commit comments

Comments
 (0)