[fix] Dimensions addEventListener returns subscription object

Fix #2130
Close #2131
This commit is contained in:
Cloud Le
2021-09-19 01:23:02 +07:00
committed by Nicolas Gallagher
parent 68e878be8f
commit 4aba2bdcf4
4 changed files with 15 additions and 5 deletions
@@ -33,7 +33,7 @@ Get a dimension (e.g., window or screen).
This should only be called server-side with an estimate for initial dimensions to be used when pre-rendering pages on the server.
{% endcall %}
{% call macro.prop('addEventListener', '(type: ?string, listener: (dimensions) => void) => void') %}
{% call macro.prop('addEventListener', '(type: ?string, listener: (dimensions) => void) => ?EmitterSubscription') %}
Add a listener to `Dimensions` changes. Listen to the `"change"` event type. The handler is called with the dimensions state.
{% endcall %}