Design Patterns · Middle · Question 44 of 75

How are event delegation and the Flyweight pattern related?

Explanation

A handler on the parent is shared by all child elements, and the unique state (which element) comes from event.target - the Flyweight's extrinsic state. This saves memory and initialization time for large lists.

Further reading

Problem with a question

Design Patterns · Middle · question 44

Test yourself

Take the Design Patterns · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz