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

@rarible/action

Package Overview
Dependencies
Maintainers
0
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rarible/action

Action is almost like async function, but actions can be divided into steps. It gives more control over action execution.

  • 0.10.0-beta.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
125
decreased by-46.35%
Maintainers
0
Weekly downloads
 
Created
Source

Action abstraction for @rarible/sdk

Action is almost like async function, but actions can be divided into steps. It gives more control over action execution.

This way frontend applications can allow users to see what step is currently executing. Also, it's possible to even control when next step should be started.

How-to create an Action

Action can be created using ActionBuilder:

import { ActionBuilder } from "@rarible/action"

const action = ActionBuilder
  .create({ id: "first-step" as const, run: (input: string) => firstStep(input) })
  .thenStep({ id: "second-step" as const, run: input => secondStep(input) })

This creates and action, which can be executed:

const result = await action("pass the input data here")

Here, result will be the result of secondStep async function.

You can run steps individually:

//First, start action, get Execution
const exec = action.start("pass the input data here")

//then run steps
await exec.run(0)
await exec.run(1)

//then get the result
const result = await exec.result

Keywords

FAQs

Package last updated on 08 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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