Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flowx

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flowx - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

42

index.js

@@ -27,3 +27,3 @@ 'use strict'

this.id = id
this.actualState = initState
this.currentState = initState
this.middlewares = []

@@ -101,5 +101,5 @@ this.internalEmitter = emitter

return new Promise((resolve, reject) => {
if (instance.actualState.transitions) {
instance.actualState.transitions.forEach((transition) => {
if (Utils.matchRule(transition.name, transitionName) || Utils.matchRegExp(transition.name, transitionName)) {
if (instance.currentState.transitions) {
instance.currentState.transitions.forEach((transition) => {
if (Utils.matchRule(transition.when, transitionName) || Utils.matchRegExp(transition.when, transitionName)) {
return resolve(transition)

@@ -121,4 +121,4 @@ }

if (transition.use) {
instance.middlewares[transition.use](instance.actualState, (data) => {
instance.actualState = nextState
instance.middlewares[transition.use](instance.currentState, (data) => {
instance.currentState = nextState

@@ -129,12 +129,12 @@ client.set(instance.id, instance, this.model.ttl, (err) => {

}
if (instance.actualState.onEnter) {
if (instance.actualState.onEnter.emit) {
instance.internalEmitter.emit(instance.actualState.onEnter.emit, instance.actualState.onEnter.data)
if (instance.currentState.onEnter) {
if (instance.currentState.onEnter.emit) {
instance.internalEmitter.emit(instance.currentState.onEnter.emit, instance.currentState.onEnter.data)
}
}
resolve(instance.actualState)
resolve(instance.currentState)
})
})
} else {
instance.actualState = nextState
instance.currentState = nextState
client.set(instance.id, instance, this.model.ttl, (err) => {

@@ -145,8 +145,8 @@ console.log('EL NUEVO ESTADO ' + JSON.stringify(instance))

}
if (instance.actualState.onEnter) {
if (instance.actualState.onEnter.emit) {
instance.internalEmitter.emit(instance.actualState.onEnter.emit, instance.actualState.onEnter.data)
if (instance.currentState.onEnter) {
if (instance.currentState.onEnter.emit) {
instance.internalEmitter.emit(instance.currentState.onEnter.emit, instance.currentState.onEnter.data)
}
}
resolve(instance.actualState)
resolve(instance.currentState)
})

@@ -158,3 +158,3 @@

this.searchNextState('default').then((nextState) => {
instance.actualState = nextState
instance.currentState = nextState
client.set(instance.id, instance, this.model.ttl, (err) => {

@@ -164,8 +164,8 @@ if (err) {

}
if (instance.actualState.onEnter) {
if (instance.actualState.onEnter.emit) {
instance.internalEmitter.emit(instance.actualState.onEnter.emit, instance.actualState.onEnter.data)
if (instance.currentState.onEnter) {
if (instance.currentState.onEnter.emit) {
instance.internalEmitter.emit(instance.currentState.onEnter.emit, instance.currentState.onEnter.data)
}
}
resolve(instance.actualState)
resolve(instance.currentState)
})

@@ -177,3 +177,3 @@ }).catch((err) => {

} else {
return resolve(instance.actualState)
return resolve(instance.currentState)
}

@@ -180,0 +180,0 @@ })

{
"name": "flowx",
"version": "2.0.3",
"version": "2.0.4",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc