krasimir / stent

Stent is combining the ideas of redux with the concept of state machines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Is there a way to know if a transaction can be applied?

poteirard opened this issue · comments

Hi,

First of all thanks for your work. I wanted to know if there's a way to know if a transaction can be applied? Something like transactionCanBeApplied() ?

Right now no but that's a good feature request. I'll implement it. Stay tuned.

The new 5.1.0 version supports is<action name>Allowed() method. For example:

{
  'idle': {
    'please run': 'running'
  },
  'running': {
    'stop please': 'idle'
  }
}

The machine has:

machine.isPleaseRunAllowed();
machine.isStopPleaseAllowed();

Even tho now this is possible can you please give some more context. I have the feeling that the usage of these helper methods may be avoided.