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

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

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27729}{}\doxysection{API}\label{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27729}
\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27730}{}\doxysubsection{Emitter(obj)}\label{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27730}
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_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27731}{}\doxysubsection{Emitter\#on(event, fn)}\label{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27731}
Register an {\ttfamily event} handler {\ttfamily fn}.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27732}{}\doxysubsection{Emitter\#once(event, fn)}\label{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27732}
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_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27733}{}\doxysubsection{Emitter\#off(event, fn)}\label{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27733}

\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_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27734}{}\doxysubsection{Emitter\#emit(event, ...)}\label{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27734}
Emit an {\ttfamily event} with variable option args.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27735}{}\doxysubsection{Emitter\#listeners(event)}\label{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27735}
Return an array of callbacks, or an empty array.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27736}{}\doxysubsection{Emitter\#has\+Listeners(event)}\label{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27736}
Check if this emitter has {\ttfamily event} handlers.\hypertarget{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27737}{}\doxysection{License}\label{md_sfcode_node_modules_socket_io_client_node_modules_socket_io_parser_node_modules_component_emitter_Readme_autotoc_md27737}
MIT 