cuter

Version, currently master branch1 version
  • master branchlatestJul 17, 2018

github.com/docelic/cuter

Papierkorb's "cute" (event-centric publish/subscribe model) with additions

2 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  cuter:
    github: docelic/cuter
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.24.2
License
MIT
Author
Davor Ocelic

Dependencies

Runtime Dependencies

  • cute*github: Papierkorb/cute

Development Dependencies

  • ameba*github: veelenga/amebadev
  • specreporter-spec*github: docelic/specreporter-specdev

README

Build status: Build Status Version License

Project status: [ ] Being developed [ ] Usable [ ] Functionally complete

Current code causes a bug: https://github.com/crystal-lang/crystal/issues/6158

Cuter is an "overlay" for Papierkorb's cute which modifies some of its built-in behavior. Specifically, it changes or adds the following:

  • Blocks return Bool instead of nil
  • Signals know their @parent object which has them
  • Signals support one-time trigger via @listeners1 and once() instead of on()
  • Every emit() also emits signal "event"
  • Every on() emits signal new_listener unless new_listener itself is added
  • Every off() emits signal remove_listener
  • Emit() and emit2() mimick _emit() and emit() from Blessed

And some other changes are included or are coming up.

In essence, this is a specialized module aiming to duplicate Blessed's event model, and is probably not usable outside of it, due to specific and contextualized behavior.