Skip to content

Commit

Permalink
Adds more about how to use the EuiWindowEvent in example docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrhodes committed Aug 20, 2018
1 parent 73f0ed0 commit e4d90d9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src-docs/src/views/window_event/window_event_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import {
GuideSectionTypes,
} from '../../components';

import {
EuiWindowEvent
} from '../../../../src/services';

import {
EuiCode,
EuiWindowEvent,
} from '../../../../src/components';

import { WindowEvent } from './window_event';
Expand All @@ -28,12 +31,13 @@ export const WindowEventExample = {
text: (
<div>
<p>
Use an <EuiCode>EuiWindowEvent</EuiCode> to safely and declaratively manage adding and auto-removing
event listeners to the <EuiCode>window</EuiCode>.
Use an <EuiCode>EuiWindowEvent</EuiCode> to safely and declaratively manage adding and auto-removing event listeners
to the <EuiCode>window</EuiCode>. This is preferable to setting up your own window event listeners because it will remove
old listeners when your component unmounts, preventing you from accidentally leaving them around forever.
</p>
<p>
This is preferable to setting up your own window event listeners because it will remove old
events when your component unmounts, preventing you from accidentally leaving them around forever.
To add a window event listener, render this component with two props: the DOM event name (e.g. click, keydown)
and a handler function that will be called when the event is triggered on the window element.
</p>
</div>
),
Expand Down

0 comments on commit e4d90d9

Please sign in to comment.