Giter Club home page Giter Club logo

mobx-preact-super-lite's Introduction

mobx-preact-super-lite

Super lightweight Preact bindings for MobX based on Preact 10.x+ and Hooks.

NPM

Base version is aligned with mobx-react-lite version.

Motivation

For now Preact app to use MobX, we need preact/compat(not just preact) and bundler alias.

But for bundle size, I want to use MobX with preact.

So, I've just copied mobx-react-lite package and added some tweaks.

With this package, you can use minimum preact package and limited mobx-react-lite APIs.

Compatibility

Roughly speaking, mobx-preact-super-lite = mobx-react-lite - observer() hoc.

API mobx-react-lite mobx-preact-super-lite
observer() (*1)
<Observer>
useLocalObservable()
enableStaticRendering()
  • *1 Original implementation requires memo() and forwardRef(), it means preact/compat is needed.

Deprecated APIs

API mobx-react-lite mobx-preact-super-lite
useObserver()
useLocalStore()
useAsObservableSource()
observerBatching() (*2)
observerBatchingOptOut() (*2)
isObserverBatched() (*2)
  • *2 We opt it out automatically.

API reference

See original repository and user guide.

mobx-preact-super-lite's People

Contributors

leaysgur avatar

Stargazers

Benjamin Keating avatar Yuichi Tateno (secon) avatar  avatar

Watchers

James Cloos avatar  avatar

mobx-preact-super-lite's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.