vstirbu / fsm-as-promised

A finite state machine library using ES6 promises
MIT License
465 stars 18 forks source link

question: enumerable event properties #6

Open boneskull opened 8 years ago

boneskull commented 8 years ago

I'm curious why "event" properties are enumerable when other properties (such as can and cannot) are not?

vstirbu commented 8 years ago

The idea at the time was that the public api surface of the fem object is just the events set, the rest would be private. The private api was used for testing or just compatibility with the inspiration.

boneskull commented 8 years ago

is it still necessary to have them either way?

vstirbu commented 8 years ago

They can be made enumerable and in addition the lib should throw an error if the state machine definition contains any event names that would conflict with the library added methods: is, can, cannot and current.