All Projects → recksjs → recks

recksjs / recks

Licence: MIT license
🐶 React-like RxJS-based framework

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to recks

Prakma
Prakma is a framework to make applications using JSX, focusing on writing functional components.
Stars: ✭ 16 (-87.97%)
Mutual labels:  dom, jsx
Jsx Dom
Use JSX to create DOM elements.
Stars: ✭ 117 (-12.03%)
Mutual labels:  dom, jsx
callbag-jsx
callbags + JSX: fast and tiny interactive web apps
Stars: ✭ 69 (-48.12%)
Mutual labels:  dom, jsx
hsx
Static HTML sites with JSX and webpack (no React).
Stars: ✭ 15 (-88.72%)
Mutual labels:  dom, jsx
Inferno Most Fp Demo
A demo for the ReactJS Tampa Bay meetup showing how to build a React+Redux-like architecture from scratch using Inferno, Most.js, reactive programmning, and various functional programming tools & techniques
Stars: ✭ 45 (-66.17%)
Mutual labels:  rxjs, jsx
prax
Experimental rendering library geared towards hybrid SSR+SPA apps. Focus on radical simplicity and performance. Tiny and dependency-free.
Stars: ✭ 18 (-86.47%)
Mutual labels:  dom, jsx
Preact
⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
Stars: ✭ 30,527 (+22852.63%)
Mutual labels:  dom, jsx
vanilla-jsx
Vanilla jsx without runtime. HTML Tag return DOM in js, No virtual DOM.
Stars: ✭ 70 (-47.37%)
Mutual labels:  dom, jsx
react-with-observable
Use Observables with React declaratively!
Stars: ✭ 108 (-18.8%)
Mutual labels:  rxjs, jsx
Preact Markup
⚡️ Render HTML5 as VDOM, with Components as Custom Elements!
Stars: ✭ 167 (+25.56%)
Mutual labels:  dom, jsx
Hyperawesome
A curated list of awesome projects built with Hyperapp & more.
Stars: ✭ 446 (+235.34%)
Mutual labels:  dom, jsx
string-dom
Create HTML strings using JSX (or functions).
Stars: ✭ 13 (-90.23%)
Mutual labels:  dom, jsx
Nativejsx
JSX to native DOM API transpilation. 💛 <div> ⟹ document.createElement('div')!
Stars: ✭ 145 (+9.02%)
Mutual labels:  dom, jsx
Angular Ru Interview Questions
Вопросы на собеседовании по Angular
Stars: ✭ 224 (+68.42%)
Mutual labels:  rxjs, dom
bassdrum
reactive, type safe components with preact and rxjs.
Stars: ✭ 44 (-66.92%)
Mutual labels:  rxjs, dom
rxnode
Rxnode - a small and fast wrapper around the nodejs API using RxJS.
Stars: ✭ 24 (-81.95%)
Mutual labels:  rxjs
phantom
👻 A reactive DOM rendering engine for building UIs.
Stars: ✭ 16 (-87.97%)
Mutual labels:  dom
AdvancedHTMLParser
Fast Indexed python HTML parser which builds a DOM node tree, providing common getElementsBy* functions for scraping, testing, modification, and formatting. Also XPath.
Stars: ✭ 90 (-32.33%)
Mutual labels:  dom
Python
covers python basic to advance topics, practice questions, logical problems in python, web development using html, css, bootstrap, jquery, DOM, Django 🚀🚀. 💥 🌈
Stars: ✭ 29 (-78.2%)
Mutual labels:  dom
spellbook
Spellbook is a bookmark extension for Chrome and Firefox
Stars: ✭ 19 (-85.71%)
Mutual labels:  rxjs

Intro to RecksJS

NPM Bundlephobia MIT license

Official docs: recks.gitbook.io

RecksJS is a framework based on streams

import Recks from 'recks';
import { timer } from 'rxjs';

function App() {
  const ticks$ = timer(0, 1000);

  return <div>
    <h1>{ ticks$ }</h1>
    <p>seconds passed</p>
  </div>
}

Try it in this online sandbox or install locally

⚠️ RecksJS is currently in beta

🔎 Overview

Observables are first class citizens in Recks ❤️

function App() {
  return <div>{ timer(0, 1000) }</div>
}

You can also do other way around: map a stream on JSX

function App() {
  return timer(0, 1000).pipe(
    map(x => <div>{ x }</div>)
  );
}

Recks will subscribe to and unsubscribe from provided streams automatically, you don't have to worry about that!

And you can use Promises that will display the result, once resolved:

function App() {
  const result = axios.get(url).then(r => r.data);

  return <div>
    { result }
  </div>
}

To get a better understanding of Recks concepts, read this article: "Intro to Recks: Rx+JSX experiment" and check out API docs section

📖 Examples

1. Hello world

Just a basic, no "moving parts"

import Recks from 'recks';

function App() {
  return <h1>Hello world!</h1>
}

2. Timer

RxJS' timer here will emit an integer every second, updating the view

import Recks from 'recks';
import { timer } from 'rxjs';

function App() {
  const ticks$ = timer(0, 1000);

  return <div>
    <h1>{ ticks$ }</h1>
    <p>seconds passed</p>
  </div>
}

online sandbox

3. Greeting

Uses a simple Subject to store local component state:

import Recks from 'recks';
import { Subject } from 'rxjs';
import { map, startWith } from 'rxjs/operators';

function App() {
  const name$ = new Subject();
  const view$ = name$.pipe(
    map(x => x ? `Hello, ${x}!` : ''),
    startWith('')
  );

  return <div>
    <input
      placeholder="enter your name"
      onInput={e => name$.next(e.target.value)}
    />
    { view$ }
  </div>
}

online sandbox

4. Counter

Traditional counter example with a Subject:

import Recks from 'recks';
import { Subject } from 'rxjs';
import { scan, startWith } from 'rxjs/operators';

function App() {
  const input$ = new Subject();
  const view$  = input$.pipe(
      startWith(0),
      scan((acc, curr) => acc + curr)
    );

  return <div>
    <button onClick={ ()=>input$.next(-1) }>
      minus
    </button>

    { view$ }

    <button onClick={ ()=>input$.next( 1) }>
      plus
    </button>
  </div>
}

online sandbox

📚 Docs

Continue reading:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].