Skip to content

Fresh javascript framework for Frontend

License

Notifications You must be signed in to change notification settings

kandros/seqflow-js

 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.4%
  • JavaScript 4.6%