Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

A basic event system implementation for Nim using no macro magic or syntax sugar!

Notifications You must be signed in to change notification settings

Nimberite-Development/Trigger-Nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trigger-Nim

Note: This is not going to be maintained purely because I think it's limited in how it can be used, and I much prefer Pulse when compared to this. Use that, or fork this repo instead please!

Trigger is a simple and half-assed attempt at an event system written in Nim, made for use in Nimberite! An example of how to use it:

type
  # Unneeded but good for clarity
  ListenerProc = proc(val: int)
  EventData = (int,)

let eventSystem = eventSystem[ListenerProc, EventData]()

discard eventSystem.addListener(
  proc(val: int) =
    echo "A: ", val
)

discard eventSystem.addListener(
  proc(val: int) =
    echo "B: ", val
)

eventSystem.fire (1,)
eventSystem.fire (2,)

About

A basic event system implementation for Nim using no macro magic or syntax sugar!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages