From baaf46ec32b715cfad5c4c73b2ad7b347036f99d Mon Sep 17 00:00:00 2001 From: Hauke D Date: Wed, 22 Aug 2018 16:10:59 +0200 Subject: [PATCH] Allow multiple state change listeners Documentation for a18fd401c541d828530e5eeb52ce801c7e3f8bd5 --- using.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/using.md b/using.md index c74e99c..67f4905 100644 --- a/using.md +++ b/using.md @@ -300,8 +300,26 @@ Defaults to `false`. Enable this option at any time to get additional trace-level output to `console.debug()`. Defaults to `false`. +#### `Perl.addStateChangeListener` + +**Added in `v0.05-beta`.** + +Pass this function a `function (from,to) {...}` to register a new handler +for state changes of the Perl interpreter. + +The states currently are: + +- `"Uninitialized"` - `Perl.init` has not been called yet. +- `"Initializing"` - `Perl.init` is currently operating. +- `"Ready" - `Perl.init` is finished and `Perl.start` can be called. +- `"Running"` - The Perl interpreter is running, `Perl.eval` and `Perl.end` may be called +- `"Ended"` - The Perl interpreter has ended. You might receive several + state change notifications for this state. + #### `Perl.stateChanged` +**Deprecated in `v0.05-beta`.** Use `Perl.addStateChangeListener` instead. + Set this to a `function (from,to) {...}` to handle state changes of the Perl interpreter. Defaults to a simple implementation that logs via `console.debug()`.