GithubHelp home page GithubHelp logo

Comments (12)

ifandelse avatar ifandelse commented on August 10, 2024

uh oh - will check this out ASAP.

from machina.js.

ifandelse avatar ifandelse commented on August 10, 2024

@dominicbarnes any chance you can provide a failing scenario? First pass with your example above:

from machina.js.

ifandelse avatar ifandelse commented on August 10, 2024

@dominicbarnes One more screen shot:

from machina.js.

dominicbarnes avatar dominicbarnes commented on August 10, 2024

Odd, I'm definitely having an issue here, but evidently I didn't get the reproduction steps right. I'll narrow this down asap

from machina.js.

ifandelse avatar ifandelse commented on August 10, 2024

Hi @dominicbarnes hope things are well - just wanted to see if you figured out what the issue was?

from machina.js.

dominicbarnes avatar dominicbarnes commented on August 10, 2024

Aha! I finally was able to reproduce this! It only happens when the FSM that you are creating via extend has a states object of it's own. Here's my newest spec to demonstrate the problem:

describe( "When extending instances with an initialState property", function() {
    it( "should properly set the initialState on the children FSMs", function() {
        var Base = machina.Fsm.extend({
            initialState: "hidden",
            states: {
                hidden: {}
            }
        });

        var Sub = Base.extend({
            // if the line below is commented out... the tests pass
            states: {}
        });

        var fsm = new Sub();

        expect(fsm.initialState).to.equal("hidden");
        expect(fsm.state).to.equal("hidden");
    });
});

Currently, using v0.3.7, I get the following result:

  0 passing (8ms)
  1 failing

  1) machina.Fsm When extending instances with an initialState property should properly set the initialState on the children FSMs:
     Error: expected 'uninitialized' to equal 'hidden'

from machina.js.

ifandelse avatar ifandelse commented on August 10, 2024

Good deal - I'm going to plug this spec in and then get it fixed. Thanks!

from machina.js.

ifandelse avatar ifandelse commented on August 10, 2024

@dominicbarnes OK - I believe I've got this resolved. When you get a sec, pull the v0.3.8 branch: https://github.com/ifandelse/machina.js/tree/v0.3.8. Your test has been added to the specs, and it's passing. I'll publish this to master & npm once I hear that it's working for you. Thanks!

from machina.js.

dominicbarnes avatar dominicbarnes commented on August 10, 2024

Looks like this all works! Publish away! :D

from machina.js.

ifandelse avatar ifandelse commented on August 10, 2024

Awesome - thanks for your patience through all of this.

from machina.js.

dominicbarnes avatar dominicbarnes commented on August 10, 2024

Thank you for your patience with me as well :)

from machina.js.

ifandelse avatar ifandelse commented on August 10, 2024

forgot to close this after I published... ;-)

from machina.js.

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.