How to use the once function from hoek

Find comprehensive JavaScript hoek.once code examples handpicked from public code repositorys.

142
143
144
145
146
147
148
149
150
151
    if (callback) {
        return callback(err, res);
    }
};

finish = Hoek.once(finish);

var onError = function (err) {

    err.trace = _trace;
fork icon107
star icon0
watch icon2

106
107
108
109
110
111
112
113
114

internals.Policy.prototype._generate = function (id, key, cached, report, callback) {

    var self = this;

    var finalize = Hoek.once(function (id, err, value, cached, report) {

        return self._finalize(id, err, value, cached, report);
    });
fork icon74
star icon0
watch icon2

22
23
24
25
26
27
28
29
30
31
};

request._protect.run('handler', finalize, function (exit) {

    if (request._route._prerequisites) {
        internals.prerequisites(request, Hoek.once(exit));
    }
    else {
        internals.handler(request, exit);
    }
fork icon0
star icon0
watch icon0

+ 3 other calls in file

89
90
91
92
93
94
95
96
97
    reply.entity = internals.entity;
}

reply._settings = options;
reply._replied = false;
reply._next = Hoek.once(next);

reply.realm = realm;
reply.request = request;
fork icon0
star icon0
watch icon2