# Event

## RSC.Event.New()

```rust
Event RSC.Event.New()
```

Creates a new Event object

```lua
-- Example of using Event class
local event = RSC.Event.New()
event:On(print)
event:Emit(1, "2", {}) -- 1    2   table 0x12faf231ac
```



## :On(...)

```rust
Event:On( func: function(...), identifier?: any )
```

Registers a new function that can be called with [Event:Emit(...)](#event-emit) function.



## :Once(...)

```rust
Event:Once( func: function(...), identifier?: any )
```

Same as [Event:On](#event-on), but `func` will be called only once



## :Remove(...)

```rust
Event:Remove( identifier: any )
```

Removes registered function by specified identifier. If identifier wasn't specified, then you can pass a function that was registered.



## :Emit(...)

```rust
Event:Emit(...)
```

Calls registered functions with passed arguments.
