MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / follow

Method follow

javascript/0355-design-twitter.js:33–37  ·  view source on GitHub ↗
(followerId, followeeId, { following } = this)

Source from the content-addressed store, hash-verified

31 }
32
33 follow(followerId, followeeId, { following } = this) {
34 if (!following.has(followerId)) following.set(followerId, new Set());
35
36 following.get(followerId).add(followeeId);
37 }
38
39 unfollow(followerId, followeeId, { following } = this) {
40 if (following.has(followerId))

Callers

nothing calls this directly

Calls 3

setMethod · 0.45
addMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected