npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rxact

v1.0.0-beta.0

Published

an observable application management for Javascript apps

Downloads

15

Readme

npm version CircleCI master Coveralls master

Rxact is an observable application management for Javascript app.

中文文档

Introduction

Rxact help developer managing application logic and state. Rxact is related to reactive programing, make sure it is what you are familiar with or you want.

Core Concept

No Store

It means there is no concept about store in Rxact, but you can still store state. In other state containers like Redux, store is a core concept, because they are forcing on state management. But for mordern Javascript application, state management is not good enough. We need to maintain complex application logic now.

Stream

Image your application from top to down, for example, from 'user login' to 'button click'. You will see lots of logic streams, and they are combined and splited. That is what Rxact thinking, managing your application in stream way.

StateStream

The core component in Rxact is StateStream, which is a stream of state. In StateStream you can define operator and event for state, then you can observe the changing of state. And StateStream can even combined together to become a new StateStream. That is the way Rxact manage your application.

Installation

yarn add rxact

Getting Started

Step 1, chosing your favorite observable lib.

Rxact supports any lib implement ECMAScript Observable . including(but not only):

Step 2, setup Rxact.

Assume you chosed RXJS, then

import { StateStream } from 'rxact'
import Rx from 'rxjs'
import { setup } from 'rxact'

setup({ Observable: Rx.Observable })

Step 3, let's start by writing a counter

import { StateStream } from 'rxact'

/**
 * StateStream is a stream for managing state and logic.
 * You shold named the stream and give it initial value.
 * After that, we can emit value and listen to it.
 */
const stream = new StateStream('stream', 0)

/**
 * Emitter is a operator for emitting new value. We define a emitter named "increment" here.
 * Everytime "increment" executed, "stream" will receive new value which equal to previous value plus input value.
*/
stream.emitter('increment', value => prevState => (prevState + value))

/**
 * Subscribing the stream and outputting values.
 * After you subscribed, it will output current value immediately, which means initial value here.
**/
stream.subscribe(value => { console.log(value) })

stream.increment(1)
// output 1.
stream.increment(1)
// output 2.
stream.increment(2)
// output 4.

For more infomation, please check documents below.

Examples

Here are more complex exmaples

You can checkout the source code on rxact-examples.

Plugins

You can enhance Rxact by adding plugins.

Docs

Coming soon ...

Lisence

MIT