mobx-utils
Advanced tools
Comparing version 6.0.1 to 6.0.3
@@ -0,0 +0,0 @@ import { IObservableArray } from "mobx"; |
@@ -0,0 +0,0 @@ var __spreadArrays = (this && this.__spreadArrays) || function () { |
@@ -0,0 +0,0 @@ import { IDisposer } from "./utils"; |
@@ -0,0 +0,0 @@ import { isAction, autorun, action, isObservableArray, runInAction } from "mobx"; |
@@ -0,0 +0,0 @@ import { IComputedValueOptions } from "mobx"; |
@@ -79,3 +79,3 @@ var __assign = (this && this.__assign) || function () { | ||
return fn.apply(_this, args); | ||
}, __assign(__assign({}, opts), { name: "computedFn(" + fn.name + "#" + ++i + ")" })); | ||
}, __assign(__assign({}, opts), { name: "computedFn(" + (opts.name || fn.name) + "#" + ++i + ")" })); | ||
entry.set(c); | ||
@@ -82,0 +82,0 @@ // clean up if no longer observed |
@@ -0,0 +0,0 @@ import { IComputedValueOptions } from "mobx"; |
@@ -0,0 +0,0 @@ var __assign = (this && this.__assign) || function () { |
@@ -0,0 +0,0 @@ import { ObservableMap, IComputedValue } from "mobx"; |
@@ -54,2 +54,3 @@ var __assign = (this && this.__assign) || function () { | ||
getAllMethodsAndProperties(model).forEach(function (key) { | ||
var _a; | ||
if (key === $mobx || key === "__mobxDidRunLazyInitializers") { | ||
@@ -60,4 +61,6 @@ return; | ||
if (isComputedProp(model, key)) { | ||
var derivation = _getAdministration(model, key).derivation; // Fixme: there is no clear api to get the derivation | ||
_this.localComputedValues.set(key, computed(derivation.bind(_this))); | ||
var computedBox = _getAdministration(model, key); // Fixme: there is no clear api to get the derivation | ||
var get = computedBox.derivation.bind(_this); | ||
var set = (_a = computedBox.setter_) === null || _a === void 0 ? void 0 : _a.bind(_this); | ||
_this.localComputedValues.set(key, computed(get, { set: set })); | ||
} | ||
@@ -74,3 +77,6 @@ var descriptor = Object.getOwnPropertyDescriptor(model, key); | ||
}, set: action(function (value) { | ||
if (value !== _this.model[key]) { | ||
if (isComputedProp(model, key)) { | ||
_this.localComputedValues.get(key).set(value); | ||
} | ||
else if (value !== _this.model[key]) { | ||
_this.localValues.set(key, value); | ||
@@ -77,0 +83,0 @@ } |
@@ -0,0 +0,0 @@ declare type BabelDescriptor = PropertyDescriptor & { |
@@ -0,0 +0,0 @@ import { addHiddenProp } from "./utils"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { IObjectDidChange, IArrayDidChange, IMapDidChange } from "mobx"; |
@@ -0,0 +0,0 @@ import { observe, isObservableMap, isObservableObject, isObservableArray, values, entries, } from "mobx"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { computed, _isComputingDerivation } from "mobx"; |
@@ -0,0 +0,0 @@ export declare type PromiseState = "pending" | "fulfilled" | "rejected"; |
@@ -0,0 +0,0 @@ import { action, extendObservable } from "mobx"; |
@@ -0,0 +0,0 @@ import { IDisposer } from "./utils"; |
@@ -0,0 +0,0 @@ import { createAtom, _allowStateChanges } from "mobx"; |
@@ -0,0 +0,0 @@ import { IComputedValue } from "mobx"; |
@@ -0,0 +0,0 @@ import { getAtom, observe } from "mobx"; |
@@ -0,0 +0,0 @@ export interface ILazyObservable<T> { |
@@ -0,0 +0,0 @@ import { observable, action, _allowStateChanges } from "mobx"; |
@@ -0,0 +0,0 @@ export * from "./from-promise"; |
@@ -0,0 +0,0 @@ export * from "./from-promise"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { _isComputingDerivation } from "mobx"; |
@@ -0,0 +0,0 @@ export interface IStreamObserver<T> { |
@@ -0,0 +0,0 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
@@ -0,0 +0,0 @@ import { IObservableArray, ObservableMap } from "mobx"; |
@@ -0,0 +0,0 @@ var __extends = (this && this.__extends) || (function () { |
@@ -0,0 +0,0 @@ import { IDisposer } from "./utils"; |
@@ -0,0 +0,0 @@ import { isAction, autorun, action, isObservableArray, runInAction } from "mobx"; |
@@ -0,0 +0,0 @@ export declare type IDisposer = () => void; |
@@ -0,0 +0,0 @@ export var NOOP = function () { }; |
{ | ||
"name": "mobx-utils", | ||
"version": "6.0.1", | ||
"version": "6.0.3", | ||
"description": "Utility functions and common patterns for MobX", | ||
@@ -5,0 +5,0 @@ "main": "mobx-utils.umd.js", |
@@ -0,0 +0,0 @@ # MobX-utils |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
305654
52
6323