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

@xstate/inspect

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xstate/inspect - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

18

es/index.js

@@ -13,2 +13,3 @@ var __assign = (this && this.__assign) || function () {

import { createMachine, assign, interpret } from 'xstate';
import { toSCXMLEvent, toEventObject } from 'xstate/lib/utils';
var serviceMap = new Map();

@@ -140,2 +141,19 @@ export function createDevTools() {

});
inspectService.send({
type: 'service.event',
event: JSON.stringify((service.state || service.initialState)._event),
id: service.id
});
// monkey-patch service.send so that we know when an event was sent
// to a service *before* it is processed, since other events might occur
// while the sent one is being processed, which throws the order off
var originalSend = service.send.bind(service);
service.send = function inspectSend(event) {
inspectService.send({
type: 'service.event',
event: JSON.stringify(toSCXMLEvent(toEventObject(event))),
id: service.id
});
return originalSend(event);
};
service.subscribe(function (state) {

@@ -142,0 +160,0 @@ inspectService.send({

@@ -16,2 +16,3 @@ "use strict";

var xstate_1 = require("xstate");
var utils_1 = require("xstate/lib/utils");
var serviceMap = new Map();

@@ -144,2 +145,19 @@ function createDevTools() {

});
inspectService.send({
type: 'service.event',
event: JSON.stringify((service.state || service.initialState)._event),
id: service.id
});
// monkey-patch service.send so that we know when an event was sent
// to a service *before* it is processed, since other events might occur
// while the sent one is being processed, which throws the order off
var originalSend = service.send.bind(service);
service.send = function inspectSend(event) {
inspectService.send({
type: 'service.event',
event: JSON.stringify(utils_1.toSCXMLEvent(utils_1.toEventObject(event))),
id: service.id
});
return originalSend(event);
};
service.subscribe(function (state) {

@@ -146,0 +164,0 @@ inspectService.send({

2

package.json
{
"name": "@xstate/inspect",
"version": "0.0.6",
"version": "0.0.7",
"description": "XState inspection utilities",

@@ -5,0 +5,0 @@ "keywords": [

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