This commit adds an after option to the object passed as the second
argument to enquire.register. If supplied, it will be triggered
once immediately after registration of the handler.
This allows you to execute any code after the handler has been added,
regardless of whether the handler was called or not.
In my use case, I'm using enquire to move a block of content into a
sidebar if a media query matches. I needed to execute some code after
the block was either moved or wasn't, and this allows me to do that.
I've thought about this more and I'm pretty sure this makes absolutely no sense. I should be able to just put my code after the call to register and get the behavior I want.
This commit adds an
after
option to the object passed as the second argument toenquire.register
. If supplied, it will be triggered once immediately after registration of the handler.This allows you to execute any code after the handler has been added, regardless of whether the handler was called or not.
In my use case, I'm using enquire to move a block of content into a sidebar if a media query matches. I needed to execute some code after the block was either moved or wasn't, and this allows me to do that.
Let me know what you think!