allevo / seqflow-js

Fresh javascript framework for Frontend

Home Page:https://seqflow.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 = 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, {});

About

Fresh javascript framework for Frontend

https://seqflow.dev

License:MIT License


Languages

Language:TypeScript 96.0%Language:JavaScript 4.0%