seqflow-js
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-beta.12 • Public • Published

SeqFlow JS

SeqFlowJS is a JavaScript library for creating and managing frontend workflows. The core ideas are:

  • Events over State Management
  • Simplicity over Complexity
  • Linearity over Complex Abstractions
  • Explicitness over Implicitiveness

See the documentation for more information.

Installation

pnpm install seqflow-js

Usage

import { SeqflowFunctionContext } from "seqflow-js";

interface Quote {
	author: string;
	content: string;
}

async function getRandomQuote(): Promise<Quote> {
	const res = await fetch("https://api.quotable.io/random")
	return await res.json();
}

export async function Main(this: SeqflowFunctionContext) {
	// Render loading message
	this.renderSync(
		<p>Loading...</p>
	);

	// Perform an async operation
	const quote = quote = await getRandomQuote();

	// Replace loading message with quote
	this.renderSync(
		<div>
			<div>{quote.content}</div>
			<div>{quote.author}</div>
		</div>
	);
}

start(document.getElementById("root"), Main, undefined, {});

Package Sidebar

Install

npm i seqflow-js

Homepage

seqflow.dev

Weekly Downloads

39

Version

0.0.1-beta.12

License

ISC

Unpacked Size

267 kB

Total Files

39

Last publish

Collaborators

  • allevo