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

@reway/core

v0.2.2

Published

Reway core logic package

Downloads

16

Readme

🌐 reway

"Buy Me A Coffee"

💨 Flexible framework-agnostic state-manager.

Motivation

The main advantages and directions for the development of reway are:

  • convenience
  • speed
  • code reuse, regardless of the framework

Documentation

  1. Install library from npm

    yarn add @reway/core

    If you want to use more convenient tools for your framework, you can install additional packages (OPTIONAL) P.S: Already we support only React.

    yarn add @reway/<framework-name>
  2. Write a simple case:

    import { atom } from "@reway/core";
      
    type ExampleStore = {
      hello: string;
    }
       
    const example = atom<ExampleStore>({
      hello: "me"
    })
  3. Listen any actions

    // You can listen for global changes in your atom by replacing "hello" (in the example above) with "data"
       
    example.on("hello", (state) => {
      console.log("Hello is changed!")
    })
  4. Change data in atom

    example.set({
      hello: "not me"
    })
  5. Get data

    example.get()
       
    // You can also choose the line you want to get
       
    example.get({
      hello: true
    })
  6. Start using it in your project, and then share your opinion with us!


Advanced features

  • combine
    import {combine, atom} from "@reway/core";
    
    const likes = atom<number>(0);
    const name = atom<string>("hello");
      	
    // The first parameter to the combine function is an array of keys for your values (optional).
    // The second parameter is the atoms.
    const post = combine(['likes', 'name'], likes, name) // The result is a default atom
    
    /*
      {
        likes: 0,
        name: "hello"
      }
    */
    console.log(post.get())
    
    likes.set(100)
    name.set("News")
    
    /*
      {
        likes: 100,
        name: "News"
      }
    */
    console.log(post.get())

TODO

  • Support for plugins (persists, etc.)

Contribution

The library needs your activity! We welcome any help.