MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / addReaction

Function addReaction

packages/utilities/src/reaction.ts:138–166  ·  view source on GitHub ↗
(
  threads: SerializedThread[],
  {
    active,
    threadId,
    messageId,
    type,
    currentUser,
  }: {
    active: boolean;
    threadId: string;
    messageId: string;
    type: string;
    currentUser: SerializedUser | null;
  }
)

Source from the content-addressed store, hash-verified

136}
137
138export function addReaction(
139 threads: SerializedThread[],
140 {
141 active,
142 threadId,
143 messageId,
144 type,
145 currentUser,
146 }: {
147 active: boolean;
148 threadId: string;
149 messageId: string;
150 type: string;
151 currentUser: SerializedUser | null;
152 }
153) {
154 if (!currentUser) {
155 return threads;
156 }
157 return threads.map((thread) =>
158 addReactionToThread(thread, {
159 threadId,
160 messageId,
161 type,
162 active,
163 currentUser,
164 })
165 );
166}

Callers 2

reaction.test.tsFile · 0.90
addReactionToThreadsFunction · 0.90

Calls 2

addReactionToThreadFunction · 0.85
mapMethod · 0.80

Tested by

no test coverage detected