update method

Future<Reaction> update(
  1. String reactionId, {
  2. Map<String, Object>? data,
  3. List<FeedId>? targetFeeds,
})

Reactions can be updated by providing the reaction ID parameter.

Changes to reactions are propagated to all notified feeds;

if the target_feeds list is updated, notifications will be added and removed accordingly.

Examples

await client.reactions.update(
  reaction.id,
  data: {'text': 'love it!'},
);

Implementation

Future<Reaction> update(
  String reactionId, {
  Map<String, Object>? data,
  List<FeedId>? targetFeeds,
}) {
  final reaction = Reaction(
    id: reactionId,
    data: data,
    targetFeeds: targetFeeds,
  );
  final token =
      userToken ?? TokenHelper.buildReactionToken(secret!, TokenAction.write);
  return _reactions.update(token, reaction);
}