0.2.2 ā€¢ Published 6 years ago

k-mobx-react v0.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

k-mobx-react

šŸš§ this is a work in progress šŸš§

Connect MobX (and mobx-state-tree) to React with plain old JS props!

This is a better isolation of concerns

CircleCI Coverage Status NPM Version Size

Contents

Purpose

This library offer the same inject API that the standard mobx-react library. What differs is about the types of props that are injected in the wrapped ReactJS component.

  • With the standard mobx-react the props injected can be observable.
  • With k-mobx-react the props injected are plain old JS objects.

Why

We feel that observable object in ReactJS component enforce bad pattern of developments:

  • It pushed the use of nested props into a ReactJS component
    • We think that flat props are best because it is easier to optimise this kind of components
  • You have to use customs PropTypes
  • You can't bind a common React Component with this kind of objects
    • We have some problems our existing React components that did not always worked as expected

Installation

  • npm install --save k-mobx-react
  • yarn add k-mobx-react

API

  • You can just change you mobx-react import with the new one: k-mobx-react
  • If you use nested props, you should changes them to use flat props

Examples

TODO

About alakarte

alakarte is created by two passionate french developers.

Do you want to contact them ? Go to their website

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago