How to use the reject function from underscore

Find comprehensive JavaScript underscore.reject code examples handpicked from public code repositorys.

1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
var isView = tmpUser.view;
ctx.logger.info("Connection closed or timed out: reason = %s", reason);
var isCloseCoAuthoringTmp = conn.isCloseCoAuthoring;
if (reason) {
  //Notify that participant has gone
  connections = _.reject(connections, function(el) {
    return el.id === conn.id;//Delete this connection
  });
  //Check if it's not already reconnected
  reconnected = yield* isUserReconnect(ctx, docId, tmpUser.id, conn.id);
fork icon171
star icon146
watch icon32

+ 7 other calls in file

1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
    await userService.deleteBlocklistEntry(user, lowerCaseUser);
} catch (err) {
    return res.send({ success: false, message: 'Block list entry failed to remove' });
}

user.blockList = _.reject(user.blockList, (user) => {
    return user === lowerCaseUser;
});

let updatedUser = await userService.getUserById(user.id);
fork icon79
star icon121
watch icon8

73
74
75
76
77
78
79
80
81
82
    provinceCard: _.find(provinceOne, (card) => card.isProvince),
    dynastyCards: _.reject(provinceOne, (card) => card.isProvince)
},
'province 2': {
    provinceCard: _.find(provinceTwo, (card) => card.isProvince),
    dynastyCards: _.reject(provinceTwo, (card) => card.isProvince)
},
'province 3': {
    provinceCard: _.find(provinceThree, (card) => card.isProvince),
    dynastyCards: _.reject(provinceThree, (card) => card.isProvince)
fork icon18
star icon17
watch icon0

+ 13 other calls in file

300
301
302
303
304
305
306
307
308
309
    this.playableLocations.push(playableLocation);
    return playableLocation;
}

removePlayableLocation(location) {
    this.playableLocations = _.reject(this.playableLocations, (l) => l === location);
}

beginRound() {
    this.passedMain = false;
fork icon9
star icon10
watch icon1

1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
emailIds.forEach(element => {
    decryptedEmailIds.push(element.toString())
});
decryptedEmailIds = _.uniq(decryptedEmailIds);
addressIds.forEach(addressId => {
    let address = _.reject(keystaffObj,(element)=>{
        return element.addressId != addressId
    })[0]
    let addressObj = {
        "addressId": address.addressId,
fork icon0
star icon0
watch icon1

+ 94 other calls in file

530
531
532
533
534
535
536
537
538
539
    return adminService.getSecurityAnswer(adminId)
})
.then(function(data){
    let securityQuestion = {};
    securityQsList.forEach(element => {
        let securityAnswer = _.reject(data,(answerObj)=>{
            return answerObj.secQsId != element.secQsId
        })
        securityQuestion = element;
        if(securityAnswer && securityAnswer.length > 0)
fork icon0
star icon0
watch icon1

32
33
34
35
36
37
38
39
40
                };
                result[idx++]=commentJson
            })
            resolve({success:true, result});
        }catch(err) {
            reject(`${err}`);
        }
    })
}
fork icon0
star icon0
watch icon1

+ 7 other calls in file

95
96
97
98
99
100
101
102
103
104
function isDirEmptyPromise(folder){
    return new Promise((resolve,reject)=>{
        if(isDirEmpty(folder)){
            resolve();
        }else{
            reject();
        }
    });
}

fork icon0
star icon0
watch icon1

+ 9 other calls in file

117
118
119
120
121
122
123
124
125
126
127
    }
};
xcode.project.prototype.removeFromPbxEmbedFrameworksBuildPhase = function (file) {
    const sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target);
    if (sources) {
        sources.files = _.reject(sources.files, file => file.comment === longComment(file));
    }
};


// special handlers to add frameworks to the 'Embed Frameworks' build phase, needed for custom frameworks
fork icon0
star icon0
watch icon0