ifandelse / machina.js

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

Remove '.' from makeFsmNamespace function #104

Closed brianmtully closed 9 years ago

brianmtully commented 9 years ago

Removed '.' from the generated namespace to enable saving machina data in MongoDB.

ifandelse commented 9 years ago

@brianmtully This actually intended to be override-able, so instead of needing to PR, you can do the following in your code:

machina.utils.makeFsmNamespace = ( function() {
    var machinaCount = 0;
    return function() {
        return "fsm" + machinaCount++;
    };
} )();

The intent of exposing utils was to allow for intelligent defaults to be overridden where needed.

brianmtully commented 9 years ago

I actually realized that after the PR. Thanks.

ifandelse commented 9 years ago

awesome, no worries :)