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

robot3

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robot3 - npm Package Compare versions

Comparing version 0.2.18 to 0.2.19

22

index.d.ts

@@ -10,3 +10,3 @@ declare module 'robot3' {

*/
export function createMachine<S, C>(
export function createMachine<S = {}, C = {}>(
initial: keyof S,

@@ -23,3 +23,3 @@ states: { [K in keyof S]: MachineState },

*/
export function createMachine<S, C>(
export function createMachine<S = {}, C = {}>(
states: { [K in keyof S]: MachineState },

@@ -98,7 +98,21 @@ context?: ContextFunction<C>

export function invoke(...args: any[]): any
/**
* The `invoke` is a special type of state that immediately invokes a Promise-returning function or another machine.
*
* @param fn - Promise-returning function
* @param args - Any argument needs to be of type Transition or Immediate.
*/
export function invoke<C, T>(fn: (ctx: C) => Promise<T>, ...args: (Transition | Immediate)[]): MachineState
/**
* The `invoke` is a special type of state that immediately invokes a Promise-returning function or another machine.
*
* @param machine - Machine
* @param args - Any argument needs to be of type Transition or Immediate.
*/
export function invoke<M extends Machine>(machine: M, ...args: (Transition | Immediate)[]): MachineState
/* General Types */
export type ContextFunction<T> = (initialContext: T) => any
export type ContextFunction<T> = (initialContext: T) => T

@@ -105,0 +119,0 @@ export type GuardFunction<C, E> = (context: C, event: E) => boolean

2

package.json
{
"name": "robot3",
"version": "0.2.18",
"version": "0.2.19",
"description": "A function, immutable Finite State Machine library",

@@ -5,0 +5,0 @@ "main": "dist/machine.js",

@@ -1,3 +0,11 @@

# 🤖 Robot
# Robot
<p align="center">
<img
alt="The Robot logo, with green background."
src="https://github.com/matthewp/robot-logo/raw/master/logo/robot-green.png"
width="40%"
/>
</p>
A small functional and immutable Finite State Machine library. Using state machines for your components brings the declarative programming approach to application state.

@@ -4,0 +12,0 @@

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