Skip to content

Counting points from user not DRY #31

@GSoster

Description

@GSoster

Right now the code below is duplicated on client/view/user/user.js and client/view/home/timeline/timeline.js

var points =  Points.listPointsFromUser(Meteor.userId());
    var totalPoints = 0;
    points.map(function(x){totalPoints += x.points;});
    return totalPoints;

A file with frequent functions should be created and this code should be put there.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions