mobx-utils
Advanced tools
Comparing version 6.0.7 to 6.0.8
/** | ||
* Disposes of all the internal Observables created by invocations of `now()`. | ||
* | ||
* The use case for this is to ensure that unit tests can run independent of each other. | ||
* You should not call this in regular application code. | ||
* | ||
* @example | ||
* afterEach(() => { | ||
* utils.resetNowInternalState() | ||
* }) | ||
*/ | ||
export declare function resetNowInternalState(): void; | ||
/** | ||
* Returns the current date time as epoch number. | ||
@@ -3,0 +15,0 @@ * The date time is read from an observable which is updated automatically after the given interval. |
@@ -5,2 +5,20 @@ import { _isComputingDerivation } from "mobx"; | ||
/** | ||
* Disposes of all the internal Observables created by invocations of `now()`. | ||
* | ||
* The use case for this is to ensure that unit tests can run independent of each other. | ||
* You should not call this in regular application code. | ||
* | ||
* @example | ||
* afterEach(() => { | ||
* utils.resetNowInternalState() | ||
* }) | ||
*/ | ||
export function resetNowInternalState() { | ||
for (var _i = 0, _a = Object.getOwnPropertyNames(tickers); _i < _a.length; _i++) { | ||
var key = _a[_i]; | ||
tickers[key].dispose(); | ||
delete tickers[key]; | ||
} | ||
} | ||
/** | ||
* Returns the current date time as epoch number. | ||
@@ -7,0 +25,0 @@ * The date time is read from an observable which is updated automatically after the given interval. |
{ | ||
"name": "mobx-utils", | ||
"version": "6.0.7", | ||
"version": "6.0.8", | ||
"description": "Utility functions and common patterns for MobX", | ||
@@ -94,2 +94,2 @@ "main": "mobx-utils.umd.js", | ||
} | ||
} | ||
} |
@@ -62,8 +62,10 @@ # MobX-utils | ||
- [Examples](#examples-9) | ||
- [resetNowInternalState](#resetnowinternalstate) | ||
- [Examples](#examples-10) | ||
- [now](#now) | ||
- [Parameters](#parameters-11) | ||
- [Examples](#examples-10) | ||
- [Examples](#examples-11) | ||
- [expr](#expr) | ||
- [Parameters](#parameters-12) | ||
- [Examples](#examples-11) | ||
- [Examples](#examples-12) | ||
- [createTransformer](#createtransformer) | ||
@@ -73,6 +75,6 @@ - [Parameters](#parameters-13) | ||
- [Parameters](#parameters-14) | ||
- [Examples](#examples-12) | ||
- [Examples](#examples-13) | ||
- [ObservableGroupMap](#observablegroupmap) | ||
- [Parameters](#parameters-15) | ||
- [Examples](#examples-13) | ||
- [Examples](#examples-14) | ||
- [ObservableMap](#observablemap) | ||
@@ -86,3 +88,3 @@ - [defineProperty](#defineproperty) | ||
- [Parameters](#parameters-16) | ||
- [Examples](#examples-14) | ||
- [Examples](#examples-15) | ||
- [DeepMapEntry](#deepmapentry) | ||
@@ -509,2 +511,17 @@ - [DeepMap](#deepmap) | ||
## resetNowInternalState | ||
Disposes of all the internal Observables created by invocations of `now()`. | ||
The use case for this is to ensure that unit tests can run independent of each other. | ||
You should not call this in regular application code. | ||
### Examples | ||
```javascript | ||
afterEach(() => { | ||
utils.resetNowInternalState() | ||
}) | ||
``` | ||
## now | ||
@@ -511,0 +528,0 @@ |
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
6567
921
314551
53