Releases: fpereiro/recalc
Releases · fpereiro/recalc
5.1.2
5.1.1
5.1.0
5.0.4
5.0.3
5.0.2
- When passing a responder
id
to afrom
entry of an event, also add theid
of the event that matched the responder, in the formresponderId/eventId
. This disambiguates which execution of a responder called an event when said responder is matched multiple times.
5.0.1
5.0.0
- Renaming of the main operations:
r.say
->r.call
,r.listen
->r.respond
,r.listeners
->r.responders
,lfun
->rfun
. - Change default path matching: the paths of event and responder must match completely.
- responder
match
function:- Arguments passed to
match
function in a responder have been reversed: the object with the event'sverb
andpath
goes now first, theresponder
goes second. - Extra arguments passed to event are now also passed to
match
function.
- Arguments passed to
- If
r.call
encounters an error, it will only pass the context tor.error
only if it received one. r.compare
has reversed the order of arguments:eventItem
, thenresponderItem
.- Eliminate
r.random
; use incrementing ids (instead of random ids) for both events and responders (the latter only when anid
is not specified by the user). This allows for easier debugging. - Passing ids to
r.respond
of the formRd...
orLd...
(whered
are digits) is now forbidden. r.log
:r.log
will now also include information on which responders were matched. For example, if an event with idE1
matches a responder with idR1
,R1
will contain an entry inr.log
with afrom
fieldE1
. This allows to track not just events, but also responders.- If an event is called by a responder (and
x
is passed toB.call
), the log entry for the event will have thefrom
field pointing to the responder's id (x.responder.id
will be used if it's present; otherwise,x.from
will be used). The information of the event that matched the responder will also be on the log. If before a chain was represented asE1 -> E2
(going throughR1
), now it will be expressed asE1 -> R1 -> E2
.
- Upgrade dale v6.0.1 -> v6.0.2, teishi v5.0.2 -> v5.0.3.
4.1.0
- Bugfix: when passing an integer as an id to a listener, convert it to string so that it can be then passed as part of
x.from
without triggering an error. - Bugfix: if passing a falsy value for an id field (either
0
or an empty string), use it instead of generating a random id. - All functions now use
r.error
(which defaults toteishi.clog
) to handle errors. r.prod
can now be set totrue
to enable production mode (validations are skipped).- Listeners of equal priority are now run by oldest first, to avoid execution sequences of unspecified order. The
index
property (an integer) was added to listeners for this purpose, plus the variabler.count
to keep the count of how many listeners were added already. - Allow for
disabled
flag in listener to turn it off temporarily (without having toforget
it). - Add benchmarking at the end of the test suite.
- Internal change: remove unnecessary argument iteration in
r.mill
.