question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] how to get additional empty variable inside state

See original GitHub issue

Hi, thank you for your work and your good choice: mealy-machine!

I’ve a little question, I’ve create new Machine thats work inside Vue.js!
Now I want to get additional parameter parentAction = new inside the state.

var stent = Machine.create('actions', {
  state: { name: 'start', parentAction: 'new' },
  transitions: {
    'start': {
      'take note': 'note',
      'create ordine': 'order',
      'take party': 'party'
    },
    'note': {
      'take another note': 'note',
      'create order': 'order',
      'take party': 'party'
    },
    'party': {
      'add participant': { name: 'participant', parentAction: 'new' }
    },
    'participant': {
      'create ordine'': 'order',
      'add participant': 'participant',
    },
...

The first state start has stent.state.parentAction = 'new', correct, but when I change the state to note the stent.state.parentAction is always new. There is a way to get undefined, null, empty variable for states that haven’t stent.state.parentAction defined?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
menteoracommented, Feb 7, 2018

Thank you, to simplify and help you, here’s my issue simulated without vuejs: https://runkit.com/menteora/stent-issue14

0reactions
krasimircommented, Feb 9, 2018

No worries. Let me know if something else is not working as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Initializing empty state that will receive a number in React
My question is to confirm whether or not that's the only option. If it were an array, we'd start with an empty array;...
Read more >
how to write empty variable.... - MATLAB Answers - MathWorks
while doing a calculation if i get a variable named "varName" with empty value i wanted to display a message "Dont not Exist".........
Read more >
Setting variables (and doing other things) with questions
So far, we have discussed questions that set a single multiple-choice variable and the use of continue button field to set a single...
Read more >
How to Define Empty Variables and Data Structures in Python
This explainer shows how to create empty variables with None and Nan in Python, as well as how to use empty data structures...
Read more >
var - JavaScript - MDN Web Docs - Mozilla
In the global context, a variable declared using var is added as a non-configurable property of the global object. This means its property ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found