jakesgordon / javascript-state-machine

A javascript finite state machine library
MIT License
8.69k stars 964 forks source link

Unified normalization rules - Transition methods should be preprocessed like lifecycle events #157

Open olgolovin opened 6 years ago

olgolovin commented 6 years ago

Hi

I believe that preprocessing normalization rules for Transition Methods should be the same like for Event Lifecycle ones.

For this example:

const fsm = new StateMachine({
    init: 'initial',
    transitions: [
        {name: 'namespace1.transitionMethod1', from: 'initial', to: 'namespace1.state1'},
        //...
    ],

    methods: {
        onNamespace1TransitionMethod1
        // ...
    }

})

i expect that namespace1.transitionMethod1 should be normalized like it has been described here Lifecycle Event Names but the transition method just dropped.

So, please add namespaces or let all methods, lifecycle events names etc follow more tolerance normalization rules/convertions