Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reusable

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reusable

Reusable is a library for reusing state and business logic between components.

  • 1.0.0-alpha.4
  • npm
  • Socket score

Version published
Weekly downloads
671
decreased by-41.4%
Maintainers
1
Weekly downloads
 
Created
Source

What?!

Reusable is a library for reusing state and business logic between components.

Should I use this now?

This is a very early stage alpha If you want to start experimenting with it and share feedback - yes If you need it for a production app - no

Why?

Reusable solves the problems that state management is meant for, with a simple and clean API, inspired and based on React hooks API.

React hooks introduced new ways of thinking about state and side-effects. These new ways made old habits obsolete, and require a new type of state management tool that embraces the same concepts:

  • Separation of concerns
  • Reusability
  • Composability
  • Simplicity

While still providing the developers with structure and architecture with large-scale apps in mind.

Features

  • managing shareable state
  • handling side effects
  • memoization
  • reactive (subscription)

Design guidelines

  • immutability
  • reusability (duh)
  • performance
  • predictability
  • encapsulation (for shared libraries / lazy loading)
  • gradually adoptable

Documentation

(https://reusablejs.github.io/reusable)[https://reusablejs.github.io/reusable]

Commonly asked questions

What about Context API?

Using Context API directly, introduces a few challenges. Deciding where in the component tree to put a certain Context is tricky, and also might change while building your app. It forces you to couple the data tree with the component tree. Reusable tries to solve these issues by decoupling the reusable state from the component tree, and by providing other benefits, such as:

  • Time Travelling
  • Single Store
  • Compound Selectors
  • Structure

Is Reusable designed for large apps?

Reusable is built with large-scale apps in mind. This is what affected most of the considerations when designing the solution:

  • The benefits of a single store and immutable data
  • The ability to do code reuse using custom hooks to prevent code duplication
  • Supporting DevTools for better debugging & QA
  • Support lazy-loaded modules

Feedback:

https://goo.gl/forms/Jza0XsM7F3shvWhD2

What's missing:

  • Tests
  • DevTools
  • Docs
  • More Examples
    • lazy-loaded modules example
    • API requests
    • Keyed states
    • 3rd party
  • Time Travelling
  • TypeScript Support
  • Better error messages

FAQs

Package last updated on 10 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc