Xstate: entry never fires on initial state

Created on 26 Nov 2019  路  3Comments  路  Source: davidkpiano/xstate

Description
The entry function never fires on the initial machine state.

Reproduction

test.js:

import { createMachine, interpret } from '@xstate/fsm';


const beaconMachine = createMachine({
    initial: 'uninitialized',
    states: {
        uninitialized: {
            entry: function () {
                console.log('I never run :( ');
            }
        }
    }
});

const beaconService = interpret(beaconMachine).start();

I run node -r esm test.js and see no console output

bug 馃 @xstatfsm

Most helpful comment

@mreinstein I've prepared a PR to fix this https://github.com/davidkpiano/xstate/pull/827

All 3 comments

@mreinstein I've prepared a PR to fix this https://github.com/davidkpiano/xstate/pull/827

@Andarist can we ship a new npm release for this?

@mreinstein done

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carlbarrdahl picture carlbarrdahl  路  3Comments

greggman picture greggman  路  3Comments

carloslfu picture carloslfu  路  3Comments

doup picture doup  路  3Comments

hnordt picture hnordt  路  3Comments