ifandelse / machina.js

js ex machina - finite state machines in JavaScript
http://machina-js.org/
Other
1.93k stars 147 forks source link

Typo in README #171

Open sfrooster opened 2 years ago

sfrooster commented 2 years ago

I'll submit a PR if no one gets to this before I do.

This page - and possibly others - indicate the "New FSM" event emitted by the top-level "machina" has an event name of newfsm (all lower-case), but the code shows the actual event name to be newFsm (capital 'F'). A minor detail, but....

sfrooster commented 2 years ago

Immediately after submitting this, I realized I hadn't reported the issue quite right. At either the top "machina" level or within a B/Fsm, there are two ways to designate a handler for an emitted event:

Looking at things now, it appears the code is expecting the to "machina" level to emit newfsm and it's only machina.eventListeners which is set to expect newFsm

ifandelse commented 2 years ago

Thanks for giving me a heads up on this @sfrooster. I've been working on an updated machina repo (in another branch) as well as a full replacement for the docs branch, and I'll look at getting this fixed (initially w/o breaking backwards compat) as part of that.

sfrooster commented 2 years ago

I came across it while working on typescript type definitions to submit to DefinitelyTyped. Should I hold-off on that?

On Sun, Jan 2, 2022, 12:06 PM Jim Cowart @.***> wrote:

Thanks for giving me a heads up on this @sfrooster https://github.com/sfrooster. I've been working on an updated machina repo (in another branch) as well as a full replacement for the docs branch, and I'll look at getting this fixed (initially w/o breaking backwards compat) as part of that.

— Reply to this email directly, view it on GitHub https://github.com/ifandelse/machina.js/issues/171#issuecomment-1003768032, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAX27F3BN27G2PYCLUOYTZDUUCV4JANCNFSM5K7CQHOQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>