Open sahandevs opened 4 years ago
Hey @sahandevs! I'd love to help out with this project, is there a particular area you could point me to as a good starting place?
Hi @ekweible! It would be awesome.
I've delayed this project but I will be back on it very soon. last thing I was working on was implementing the interpreter based on https://www.w3.org/TR/scxml (implemented part is here: https://github.com/sahandevs/xstate.dart/blob/master/packages/xstate/lib/src/interpreter/helpers.dart)
There are few todos there but the next thing i was going to work on was writing some test for the functions there. writing test for them should not be hard because they are bunch of independent function.
Thanks!
Machine Definition
Defining https://www.w3.org/2011/04/SCXML/scxml.xsd with dart models.
Translation
Convert a machine that user provides to the machine definition format.
machine.fromJson
: xstatejs formatmachine.fromSCXML
: scxml formatInterpreter
An interpreter takes one Machine Definition (required), one Initial State and zero or more hooks and returns a Machine Instance.
Hooks
hook to an internal event of the interpreter. (
onRaiseError
,onStateChanged
, ... )Machine Instance
provides these properties:
Stream<State> state
: current state of the machineState
:value
: current state valuematches(State pattern)
: check if the state matches a patterncontext
void send(Event event)
: sends event to the machineFlutter
Basic Tooling
Machine.fromJson
with https://github.com/davidkpiano/xstate/pull/960/files#diff-573778b9503823ca0d77478e05c11054Machine.fromSCXML
with https://www.w3.org/2011/04/SCXML/scxml.xsd