Skip to content

what is richText.type.transformPresence ? #369

@welkinwong

Description

@welkinwong

I found this from /examples/rich-text-presence/rich-text.js

var richText = require('rich-text');

richText.type.transformPresence = function(presence, op, isOwnOp) {
  if (!presence) {
    return null;
  }

  var start = presence.index;
  var end = presence.index + presence.length;
  var delta = new richText.Delta(op);
  start = delta.transformPosition(start, !isOwnOp);
  end = delta.transformPosition(end, !isOwnOp);

  return Object.assign({}, presence, {
    index: start,
    length: end - start
  });
};

module.exports = richText;

but delete it, still works
so do i need this ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions