eventsystem ~master
Super tiny event system using delegates
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Tiny Event System
Its just 35 lines of code + unittests and it supports regular events & cancelable events!
Usage:
import tinyevent;
// Regular event
Event!string onStringChange;
static assert(isEvent!onStringChange);
static assert(isEmittable!onStringChange);
onStringChange ~= (str) { /* Handle new string */ };
onStringChange.emit("Foo");
import tinyevent;
// Cancelable
Cancelable!bool onQuit;
static assert(isCancelable!onQuit);
static assert(isEmittable!onQuit);
onQuit ~= (force) { return force || !saved; }
// When pressing X:
if(!onQuit.emit(false))
showUnsavedChangesDialog();
else
exit();
- Registered by WebFreak
- ~master released 3 years ago
- WebFreak001/EventSystem
- public domain
- Copyright © 2015-2021, webfreak
- Authors:
- Dependencies:
- none
- Versions:
-
2.0.0 2021-Jun-10 1.3.0 2021-Jun-10 1.2.0 2017-Apr-11 1.1.0 2016-Jan-16 1.0.1 2015-Nov-15 - Download Stats:
-
-
2 downloads today
-
9 downloads this week
-
38 downloads this month
-
11937 downloads total
-
- Score:
- 1.8
- Short URL:
- eventsystem.dub.pm