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

genjijs-umd

v0.3.0

Published

Explore a better way to manage data state

Downloads

5

Readme

English | 简体中文

Genji

npm version CircleCI Coverage Status dependencies Status devDependencies Status downloads

A super-lightweight (core code only 5KB) data state management scheme based on redux and redux-thunk. (Inspired by dva )


竜神の剣を喰らえ! -- shimada genji


Features :new:

  • Use namespaces to separate different businesses, and centralize all data processing logic belong to the common namespace in the same place. to facilitate unified data management and provide a pluggable experience for modules.
  • Enhanced actionCreator of redux to provide a more friendly data access methods. Users do not need to write reducer repeatedly. Unified synchronous and asynchronous experience in updating state.
  • The built-in loading state for asynchronous operation makes it easier to get the current operation progress.

Installation :gear:

Assuming you are using npm as your package manager, execute the following command in your project directory:

npm install --save genjijs

If you use yarn, you can also:

yarn add genjijs

Quick Start :beginner:

There is a simple example in this project which used all common features of Genji . Click here to see。

In addition, the following demo may help you become more familiar with Genji :

  • example-typescript:If you want to have full Typescript supports, refer this.

  • TodoList:A copy of TodoList given by example from Redux project, but use Genji to rewrite.


Q & A :book:

  • Difference from dva

dva is an excellent open source project worldwide, and is also the source of inspiration for this project (this can be seen from the project name). Specially thanks to dva.

In the dva project, redux-saga is used as an asynchronous solution, which makes developers have to use the generator feature to make asynchronous requests, which is different from the mainstream asynchronous invocation methods which used async and Promise , and these may cause some confusion for junior developers. Therefore, in Genji, the redux-thunk written by Dan, the author of Redux, was adopted as our asynchronous solution.

Considering the user habits and functional enhancements brought by redux-saga, we have enhanced the capabilities of redux-thunk by hijack & injection, so that users can define asynchronous function like redux-saga but have supports of async and Promise.

TODO :construction:

  • [x] Built-in loading state for asynchronous operation
  • [x] Added save and pick methods for effects to access state
    • [x] Create the reducer asynchronously and inject it into the original reducer tree
    • [x] Extend redux-thunk and hijack dispatch, to extend parameter in
    • [x] Implement save & pick
    • [ ] Enhance save & pick, like get&set from other model or support parsing more parameter types
  • [x] Add Continuous integration, eslint, and unit test.
  • [x] Integrate reducers & effects
  • [x] Rewrite Aciton Type, to support definition jumps & smart tips
  • [x] A full support of Typescript
  • [ ] Document

LICENSE

MIT