ReactionProtocol
public protocol ReactionProtocol : Decodable, Encodable, Equatable
A reaction protocol.
-
Undocumented
Declaration
Swift
associatedtype ExtraDataType = ReactionExtraDataProtocol
-
Undocumented
Declaration
Swift
associatedtype UserType = UserProtocol
-
Reaction id.
Declaration
Swift
var id: String { get }
-
A User of the reaction.
Declaration
Swift
var user: UserType { get }
-
Type of reaction.
Declaration
Swift
var kind: ReactionKind { get }
-
An extra data for the reaction.
Declaration
Swift
var data: ExtraDataType { get }
-
User own children reactions, grouped by reaction type.
Declaration
Swift
var userOwnChildren: [ReactionKind : [Self]]? { get set }
-
Children reactions, grouped by reaction type.
Declaration
Swift
var latestChildren: [ReactionKind : [Self]] { get set }
-
Child reaction count, grouped by reaction kind
Declaration
Swift
var childrenCounts: [ReactionKind : Int] { get set }
-
hasUserOwnChildReaction(_:
Extension method) Check if the user has own child reactions for the reaction with a given reaction kind.
Declaration
Swift
public func hasUserOwnChildReaction(_ reactionKind: ReactionKind) -> Bool
Parameters
reactionKind
a kind of the child reaction.
Return Value
true if exists the child reaction of the user.
-
userOwnChildReactionsCount(_:
Extension method) The number of user own child reactions with a given reaction kind.
Declaration
Swift
public func userOwnChildReactionsCount(_ reactionKind: ReactionKind) -> Int
Parameters
reactionKind
a kind of the child reaction.
Return Value
the number of user own child reactions.
-
userOwnChildReaction(_:
Extension method) Try to get the first user own child reaction.
Declaration
Swift
public func userOwnChildReaction(_ reactionKind: ReactionKind) -> Self?
Parameters
reactionKind
a kind of the child reaction.
Return Value
the user child reaction.
-
addUserOwnChild(_:
Extension method) Update the reaction with a new user own child reaction.
Declaration
Swift
public mutating func addUserOwnChild(_ reaction: Self)
Parameters
reaction
a new user own reaction.
-
removeUserOwnChild(_:
Extension method) Delete an existing user own child reaction for the reaction.
Declaration
Swift
public mutating func removeUserOwnChild(_ reaction: Self)
Parameters
reaction
an existing user own reaction.