eventsystem 2.0.0
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();
- 2.0.0 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:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
2 downloads total
-
- Score:
- 1.0
- Short URL:
- eventsystem.dub.pm