Giter VIP home page Giter VIP logo

Comments (4)

mogsie avatar mogsie commented on May 18, 2024

It should be noted that this is from the possible extensions to the formalism chapter, and not part of the original formalism per se. SCXML and most other have them as explicitly hierarchical, so I'm not too keen on this :) "after 2s" is way higher on my list!

Other than that, I haven't experienced the need for it. Yes, there might be portions of a statechart that need to be duplicated (e.g. that α and β arrows need to be duplicated in the C state), I'm thinking that there might be better ways of dealing with that, other than overlapping states. Maybe reusable chunks of on handlers when defining the state machine itself.

const handleAlpha = { "α", "elsewhere1"}
const handleBeta = { "β": "elsewhere2" };

const states = {
  A: {
    on: handleAlpha,
    states: {
      B: {}
      C: { on: hanldeBeta}
    }
  }
  D: {
    on: handleBeta,
    states: {
      E: {}
      F: {}
      C: { on: hanldeAlpha}
    }
  }
}

The spread operator could be used to combine many signals.

from xstate.

davidkpiano avatar davidkpiano commented on May 18, 2024

That's true - I'll mark this as Documentation so that we can just show how this can be accomplished with ES6.

from xstate.

davidkpiano avatar davidkpiano commented on May 18, 2024

I'd still like to support this eventually - although it can be accomplished with ES6 language features, you lose the details of states being related, and that's important meta information to have when visualizing the statecharts.

from xstate.

brucou avatar brucou commented on May 18, 2024

I can;t find the reference for the paper but this feature had been investigated by Harel and they discarded it because of the added complexity, the perceived lower readability and the lack of actual use cases. aah found it :

One is the notion of overlapping states,
whereby you want the and/or state hierarchy in statecharts
to be a directed graph, not a tree. (...) We found that
the issue was pretty complicated since, e.g., overlapping
can be intermixed not only with the substate facet of the
hierarchy but also with orthogonal components. We
actually concluded that the complications might outweigh
the benefits of implementing the feature.

from xstate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.