Giter VIP home page Giter VIP logo

Comments (6)

Andarist avatar Andarist commented on July 21, 2024 1

And that is already somewhat supported because createMachine doesn't require us to provide implementations right away. As you might suspect I'm just worried about the implications for syncing editor changes to source files if we'd allow this - because I'm worried that the "external" config in this example isn't a single self-contained node.

from xstate-tools.

Andarist avatar Andarist commented on July 21, 2024

Could you expand on why do you want this feature? While some machines might not be loaded now because of that it's an easy refactor. So I assume that your intention is to keep machine configs outside of the createMachine call and I'm wondering why this is important for you.

from xstate-tools.

mattpocock avatar mattpocock commented on July 21, 2024

Having options outside of the same file as the config is sometimes useful - especially when the config is ~1000 lines long.

from xstate-tools.

nicholas570 avatar nicholas570 commented on July 21, 2024

Main reason is I'm working with several machines with complex and long config. As Matt said, in this case it's very useful to have options outside. It makes my machines much more readable and makes my development experience much better. Also for new comers, I noticed it was easier to get into machines and behaviors splitting the config and the options.

from xstate-tools.

Andarist avatar Andarist commented on July 21, 2024

It's possible to createMachine in a single file and use machine.withConfig in another. Isn't this sufficient for your needs?

from xstate-tools.

nicholas570 avatar nicholas570 commented on July 21, 2024

Yeah it will be fine :)

from xstate-tools.

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.