Lines Matching refs:once
1 # once chapter
3 Only call a function once.
8 var once = require('once')
11 cb = once(cb)
13 loader.once('load', cb)
14 loader.once('error', cb)
21 // only has to be done once
22 require('once').proto()
25 cb = cb.once()
27 loader.once('load', cb)
28 loader.once('error', cb)
41 var once = require('once')
44 cb = once(cb)
46 stream.once('data', cb)
47 stream.once('end', function () {
53 ## `once.strict(func)`
57 Some functions are expected to be called only once. Using `once` for them would
60 In the example below, the `greet` function has to call the callback only once:
75 greet(null, once(msg))
77 // once.strict will print 'Hello anonymous' and throw an error when the callback will be called the…
78 greet(null, once.strict(msg))