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

@react3l/react3l

v4.0.2

Published

@react3l/react3l ----------------

Downloads

23

Readme

@react3l/react3l

React3L v4 has been fully rewritten from scratch. This repository now contains the core code, common services and repositories which are used in almost cases (both for web and mobile)

Installation

Config .nmprc to download packages from GitHub registry:

@react3l:registry=https://npm.pkg.github.com
registry=https://registry.npmjs.org

Install packages:

yarn add @react3l/react3l axios rxjs @react3l/axios-observable moment react-i18next i18next yup

Install dev packages:

yarn add -D react3l-cli i18next-extractor npm-run-all

Repository

Repository is the layer which contains all data accession code. (HTTP API, LocalStorage, AsyncStorage, Database, ...).

Most of repository's methods are API calls, which can be Promise or Observable (rxjs).

If a repository data access task is asynchronous and called in an useEffect() hook, it must be unsubscribed and cleaned up in the returned cleanup function. You should use Observable to handle this.

All repositories must extend the base Repository class.

Service

Service is the business layer. It is just a class whose methods are custom hooks or pure functions to handle logic of a specific domain.

All custom hooks and custom hook calls should respect the Single-Purpose principle. Each service should handle logic for only one domain. Each method should handle only one specific logic of its domain.

View

View is the presentation layer. (It's called view on Web and screen on Mobile app).

A view should be a component which contains only JSX and service calls to render.

Model

Model is the name of all objects in the app:

  • Data access object
  • Data transfer object
  • Business object

Because Javascript is a dynamic language. It does not require all fields of an object to explicitly have a value. All fields can be safely defined in the class. The property's values of their instances will be assigned in the data access layer where they are defined.

Internationalization

react3l use i18next and react-i18next packages for internationalization. We provide a CLI package i18next-extractor for managing the translation resources

  • Define the languages
  • Extracting the language keys
  • Merging the translated files (JSON format)