Event emitter component.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27627}{}\doxysection{Installation}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27627}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ component install component/emitter }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27628}{}\doxysection{API}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27628}
\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27629}{}\doxysubsection{Emitter(obj)}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27629}
The {\ttfamily Emitter} may also be used as a mixin. For example a \char`\"{}plain\char`\"{} object may become an emitter, or you may extend an existing prototype.

As an {\ttfamily Emitter} instance\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var Emitter = require('emitter');}
\DoxyCodeLine{var emitter = new Emitter;}
\DoxyCodeLine{emitter.emit('something'); }

\end{DoxyCode}


As a mixin\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var Emitter = require('emitter');}
\DoxyCodeLine{var user = \{ name: 'tobi' \};}
\DoxyCodeLine{Emitter(user);}
\DoxyCodeLine{}
\DoxyCodeLine{user.emit('im a user'); }

\end{DoxyCode}


As a prototype mixin\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var Emitter = require('emitter');}
\DoxyCodeLine{Emitter(User.prototype); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27630}{}\doxysubsection{Emitter\#on(event, fn)}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27630}
Register an {\ttfamily event} handler {\ttfamily fn}.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27631}{}\doxysubsection{Emitter\#once(event, fn)}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27631}
Register a single-\/shot {\ttfamily event} handler {\ttfamily fn}, removed immediately after it is invoked the first time.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27632}{}\doxysubsection{Emitter\#off(event, fn)}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27632}

\begin{DoxyItemize}
\item Pass {\ttfamily event} and {\ttfamily fn} to remove a listener.
\item Pass {\ttfamily event} to remove all listeners on that event.
\item Pass nothing to remove all listeners on all events.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27633}{}\doxysubsection{Emitter\#emit(event, ...)}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27633}
Emit an {\ttfamily event} with variable option args.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27634}{}\doxysubsection{Emitter\#listeners(event)}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27634}
Return an array of callbacks, or an empty array.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27635}{}\doxysubsection{Emitter\#has\+Listeners(event)}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27635}
Check if this emitter has {\ttfamily event} handlers.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27636}{}\doxysection{License}\label{md_sfcode_node_modules_socket_io_client_node_modules_component_emitter_Readme_autotoc_md27636}
MIT 