@lomray/react-mobx-manager 1.0.0-beta.3 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Mobx stores manager for React
2
2
 
3
+
4
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Lomray-Software_react-mobx-manager)
5
+ [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Lomray-Software_react-mobx-manager)
6
+ [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Lomray-Software_react-mobx-manager)
7
+ [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Lomray-Software_react-mobx-manager)
8
+ [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Lomray-Software_react-mobx-manager)
9
+ [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=Lomray-Software_react-mobx-manager)
10
+ [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Lomray-Software_react-mobx-manager)
11
+
3
12
  ## Usage
4
13
 
5
14
  1. Install package:
@@ -17,7 +17,7 @@ const withStores = (Component, stores) => {
17
17
  const storesMap = Object.entries(stores);
18
18
  const ObservableComponent = mobxReactLite.observer(Component);
19
19
  const componentName = Component.displayName || Component.name;
20
- const Element = React__default["default"].memo(({ ...props }) => {
20
+ const Element = ({ ...props }) => {
21
21
  const storeManager = context.useStoreManagerContext();
22
22
  const [initStores] = React.useState(() => storeManager.createStores(storesMap));
23
23
  /**
@@ -26,7 +26,7 @@ const withStores = (Component, stores) => {
26
26
  */
27
27
  React.useEffect(() => storeManager.mountStores(initStores), [initStores, storeManager]);
28
28
  return React__default["default"].createElement(ObservableComponent, { ...initStores, ...props });
29
- });
29
+ };
30
30
  hoistNonReactStatics__default["default"](Element, Component);
31
31
  Element.displayName = `Mobx(${componentName})`;
32
32
  return Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lomray/react-mobx-manager",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.4",
4
4
  "description": "This package provides Mobx stores manager for react.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -31,6 +31,7 @@
31
31
  "homepage": "https://github.com/Lomray-Software/react-mobx-manager",
32
32
  "scripts": {
33
33
  "build": "rollup -c",
34
+ "build:dev": "rollup -c --environment BUILD:development",
34
35
  "build:watch": "rollup -c -w --environment BUILD:development",
35
36
  "prettier:format": "prettier --write 'src/**/*.{ts,tsx,*.ts,*tsx}'",
36
37
  "prettier:check": "prettier --check --debug-check 'src/**/*.{ts,tsx,*.ts,*tsx}'",