Skip to content

Commit

Permalink
added callback to submitOp on asset
Browse files Browse the repository at this point in the history
  • Loading branch information
kpal81xd committed Sep 5, 2024
1 parent 5f4a807 commit 075302b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/realtime/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ class RealtimeAsset extends Events {
* Submits sharedb operation
*
* @param {object} op - The operation
* @param {function} [callback] - The callback
*/
submitOp(op) {
submitOp(op, callback) {
if (!this._loaded) return;

try {
this._document.submitOp([op]);
this._document.submitOp([op], callback);
} catch (err) {
console.error(err);
this._realtime.emit('error:asset', err, this._uniqueId);
Expand Down

0 comments on commit 075302b

Please sign in to comment.