All Projects → jarlah → react-rxjs-flux

jarlah / react-rxjs-flux

Licence: MIT license
a small library for creating applications based on unidirectional data flow

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to react-rxjs-flux

Rxloop
rxloop = Redux + redux-observable (Inspired by dva)
Stars: ✭ 44 (+100%)
Mutual labels:  flux-architecture, rxjs
Tydux
Type safe state management for web applications
Stars: ✭ 33 (+50%)
Mutual labels:  flux-architecture, rxjs
vuse-rx
Vue 3 + rxjs = ❤
Stars: ✭ 52 (+136.36%)
Mutual labels:  rxjs
fullstack-typescript
A demo project of a full stack typescript application
Stars: ✭ 28 (+27.27%)
Mutual labels:  rxjs
firebase-rxjs
Firebase with Observables, Type Checking of Schema, Zone.js aware and Angular ready.
Stars: ✭ 17 (-22.73%)
Mutual labels:  rxjs
learnrxjs
Русскоязычная документация RxJS
Stars: ✭ 20 (-9.09%)
Mutual labels:  rxjs
observer-spy
This library makes RxJS Observables testing easy!
Stars: ✭ 310 (+1309.09%)
Mutual labels:  rxjs
rdeco
响应式对象编程库,从时间和空间上解耦你的代码
Stars: ✭ 54 (+145.45%)
Mutual labels:  rxjs
clifm
The shell-like, command line terminal file manager: simple, fast, extensible, and lightweight as hell
Stars: ✭ 825 (+3650%)
Mutual labels:  kiss
ngx-translate-module-loader
Highly configurable and flexible translations loader for @ngx-translate/core
Stars: ✭ 31 (+40.91%)
Mutual labels:  rxjs
expo-ticket-app
💎 A React Native ticket app to start learning Expo very quickly with selected libraries 📚
Stars: ✭ 87 (+295.45%)
Mutual labels:  flux-architecture
thruway.js
RxJS WAMPv2 Client
Stars: ✭ 28 (+27.27%)
Mutual labels:  rxjs
KissCoC
A no-nonsense & no-drama, 100%-inclusive Code of Conduct that strives to Keep It Super Simple
Stars: ✭ 19 (-13.64%)
Mutual labels:  kiss
rxjs-sort-visualization
sorting algorithm visualization build by Rxjs 🐠
Stars: ✭ 16 (-27.27%)
Mutual labels:  rxjs
react-nonav
Experimental React Native declarative navigation
Stars: ✭ 58 (+163.64%)
Mutual labels:  rxjs
rxhr
Tiny Observable based HTTP client for browsers
Stars: ✭ 15 (-31.82%)
Mutual labels:  rxjs
gitlab-teams
🦊 Follow merge requests (&more) like a boss 🦊
Stars: ✭ 38 (+72.73%)
Mutual labels:  rxjs
observable-profiler
Tracks new & disposed Observable subscriptions
Stars: ✭ 41 (+86.36%)
Mutual labels:  rxjs
ccex-api
Cryptocurrency exchanges realtime api wrapper
Stars: ✭ 29 (+31.82%)
Mutual labels:  rxjs
reactive-angular-workshop
This is the source code for the world's greatest Reactive Angular Workshop.
Stars: ✭ 30 (+36.36%)
Mutual labels:  rxjs

react-rxjs-flux

A small library for creating applications based on unidirectional flux like data flow with RxJS. Now with support for RxJS 6.

NPM

Install

yarn add react-rxjs-flux

Usage

// view.tsx
export type ViewProps = {
  number: number,
  inc: () => void,
  dec: () => void
};

const View = (props: ViewProps) => (
    <div>
      {props.number}
      <button onClick={props.inc}>+</button>
      <button onClick={props.dec}>-</button>
    </div>
);

export default View;
// store.ts
import { createStore } from 'react-rxjs';
import { merge, Subject, Observable } from "rxjs";
import { map } from "rxjs/operators";

export const inc$ = new Subject<void>();
export const dec$ = new Subject<void>();

const reducer$: Observable<(state: number) => number> = merge(
    inc$.pipe(map(() => (state: number) => state + 1)),
    dec$.pipe(map(() => (state: number) => state - 1))
);

const store$ = createStore("example", reducer$, 0);

export default store$;
// container.ts
import { connect } from 'react-rxjs';
import store$, { inc$, dec$ } from './store';
import View, { ViewProps } from './view';

const mapStateToProps = (storeState: number): ViewProps => ({
    number: storeState,
    inc: () => inc$.next(),
    dec: () => dec$.next(),
});

export default connect(store$, mapStateToProps)(View);

License

MIT

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].