Closed DrRek closed 4 years ago
Now likes in hashtag feeds is't not done if there is no liked.subscribe()
in main.
if likeLimit is set to 0 it will not continue forever.
Now instead of having likeLimit
number of likes per hashtag each hashtag will have is own like number. The sum of all the like of all the hashtags will be equal (or real close) to likeLimit.
example.
if like limit is 10 and hashtags are ['one', 'two', 'three']
then executing once we could get 3 likes on 'one', 4 likes on 'two', 3 likes on 'three'
executing a second time could lead to 5 likes on 'one', 2 on 'two' and 2 on three
Note that the second time the sum is equal to 11, this might happen due to the Math.round() on Math.random() done in likesForTags()
in features/utils
. This could be solved but more randomness of this kind it think that plays on our favor.
While writing this it just came to my mind that maybe we should also randomize the order in which tags will be visited and each time we should only select a subsets of all the tags. If you like the idea @breuerfelix i could create a separate task for this, but for now i would like to give more priority to other tasks (such as implementing new features)
since you perfectly implemented this, i will close the issue :)
Fixed problems:
liked$.subscribe()
was not explicitly called inmain.ts
.