An open API service indexing awesome lists of open source software.

https://github.com/docelic/cuter

Papierkorb's "cute" (event-centric publish/subscribe model) with additions
https://github.com/docelic/cuter

Last synced: about 1 year ago
JSON representation

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

Awesome Lists containing this project

README

          

**Build status**: [![Build Status](https://travis-ci.com/crystallabs/cuter.svg?branch=master)](https://travis-ci.com/crystallabs/cuter)
[![Version](https://img.shields.io/github/tag/crystallabs/cuter.svg?maxAge=360)](https://github.com/crystallabs/cuter/releases/latest)
[![License](https://img.shields.io/github/license/crystallabs/cuter.svg)](https://github.com/crystallabs/cuter/blob/master/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](https://github.com/Papierkorb/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](https://github.com/chjj/blessed)'s event model, and is probably not usable outside of it, due to specific and contextualized behavior.