Skip to content

(DOCSP-41633): Consolidation: Incorporate Counter and Progress Notifications updates #3331

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

Merged
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ as a double between 0.0 and 1.0.

Once you no longer wish to receive notifications, unregister the token with
``token.Dispose()``.

In the following example, we subscribe to a progress observable on the
``session`` to listen for upload events. When this callback is triggered, it
prints the upload progress as a percentage.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To initialize a :js-sdk:`Counter <classes/Realm.Types.Counter.html>`, create
your object using the ``realm.create()`` method. Pass in your :ref:`object
schema <sdks-object-schema>` and initial counter value, as well as initial
values for any other properties the object has.

After initialization, you can use the following methods to modify the counter
value:

- ``increment()`` and ``decrement()`` update the underlying value by a
specified number.
- ``set()`` reassigns the counter to a specified value.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@
- id: javascript
content: |

.. literalinclude:: /examples/MissingPlaceholders/api.js
.. literalinclude:: /examples/generated/node/data-types.test.snippet.initialize-counter.js
:language: javascript
:copyable: false

- id: kotlin
content: |
Expand All @@ -63,6 +62,5 @@
- id: typescript
content: |

.. literalinclude:: /examples/MissingPlaceholders/api.ts
.. literalinclude:: /examples/generated/node/data-types.test.snippet.initialize-counter.ts
:language: typescript
:copyable: false
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- id: csharp
content: |

.. literalinclude:: /examples/MissingPlaceholders/example.cs
.. literalinclude:: /examples/generated/dotnet/ProgressNotifications.snippet.upload-download-progress-notification.cs
:language: csharp

- id: dart
Expand Down
4 changes: 2 additions & 2 deletions source/sdk/crud/create/create-property-types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ counter.
.. tab::
:tabid: javascript

.. include:: /includes/api-details/javascript/crud/create-counter-property-type-not-supported.rst
.. include:: /includes/api-details/javascript/crud/create-counter-property-type-description.rst

.. tab::
:tabid: kotlin
Expand All @@ -174,7 +174,7 @@ counter.
.. tab::
:tabid: typescript

.. include:: /includes/api-details/typescript/crud/create-counter-property-type-not-supported.rst
.. include:: /includes/api-details/javascript/crud/create-counter-property-type-description.rst

.. include:: /includes/sdk-examples/crud/create-counter-property-type.rst

Expand Down
Loading