Great article and interesting execution! I have one question - could you elaborate a bit more on the cleanUp function, its expected usage, and your thinking behind it?
@david,
Setting up multiple events listeners on a document can have a performance impact on the document, therefore it is advisable to remove listeners when they are not in use. (It also helps to prevent memory leakage).
@david,
Setting up multiple events listeners on a document can have a performance impact on the document, therefore it is advisable to remove listeners when they are not in use. (It also helps to prevent memory leakage).
Rahul,
Great article and interesting execution! I have one question - could you elaborate a bit more on the cleanUp function, its expected usage, and your thinking behind it?
Thanks!
@david,
Setting up multiple events listeners on a document can have a performance impact on the document, therefore it is advisable to remove listeners when they are not in use. (It also helps to prevent memory leakage).
It can be used this way:
@david,
Setting up multiple events listeners on a document can have a performance impact on the document, therefore it is advisable to remove listeners when they are not in use. (It also helps to prevent memory leakage).
It can be used in this way: