Skip to content

Commit

Permalink
Published version 5.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviergonz committed Feb 21, 2020
1 parent d70400d commit c0c8065
Show file tree
Hide file tree
Showing 20 changed files with 7,645 additions and 7,645 deletions.
22 changes: 11 additions & 11 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
root = true

[*]
end_of_line = lf
charset = utf-8
indent_style = space
tab_width = 4

[{package.json}]
indent_style = space
indent_size = 2
root = true

[*]
end_of_line = lf
charset = utf-8
indent_style = space
tab_width = 4

[{package.json}]
indent_style = space
indent_size = 2
22 changes: 11 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
node_modules
*.log
lib
coverage
mobx-utils.module.js
mobx-utils.umd.js
.idea
/.test-ts/
*.iml
*.ipr
*.iws
node_modules
*.log
lib
coverage
mobx-utils.module.js
mobx-utils.umd.js
.idea
/.test-ts/
*.iml
*.ipr
*.iws
14 changes: 7 additions & 7 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"printWidth": 100,
"semi": false,
"tabWidth": 4,
"singleQuote": false,
"useTabs": false
}
{
"printWidth": 100,
"semi": false,
"tabWidth": 4,
"singleQuote": false,
"useTabs": false
}
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: node_js
node_js:
- 8
cache:
directories:
- node_modules
install:
- yarn install
script:
- yarn run coverage
after_success:
- cat ./coverage/lcov.info|./node_modules/coveralls/bin/coveralls.js
language: node_js
node_js:
- 8
cache:
directories:
- node_modules
install:
- yarn install
script:
- yarn run coverage
after_success:
- cat ./coverage/lcov.info|./node_modules/coveralls/bin/coveralls.js
40 changes: 20 additions & 20 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": ["--ci", "-i", "${fileBasenameNoExtension}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
"skipFiles": ["${workspaceFolder}/node_modules/**/*.js", "<node_internals>/**/*.js"],
"cwd": "${workspaceFolder}"
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": ["--ci", "-i", "${fileBasenameNoExtension}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
"skipFiles": ["${workspaceFolder}/node_modules/**/*.js", "<node_internals>/**/*.js"],
"cwd": "${workspaceFolder}"
}
]
}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"typescript.tsdk": "./node_modules/typescript/lib"
{
"typescript.tsdk": "./node_modules/typescript/lib"
}
2 changes: 1 addition & 1 deletion .watchmanconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2016 MobX

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2016 MobX
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,46 +465,46 @@ Returns **IDisposer** disposer function that can be used to cancel the when prem

## keepAlive

MobX normally suspends any computed value that is not in use by any reaction,
and lazily re-evaluates the expression if needed outside a reaction while not in use.
`keepAlive` marks a computed value as always in use, meaning that it will always fresh, but never disposed automatically.

### Parameters

- `_1`
- `_2`
- `computedValue` **IComputedValue&lt;any>** created using the `computed` function
- `target` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** an object that has a computed property, created by `@computed` or `extendObservable`
- `property` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the property to keep alive

### Examples

```javascript
const number = observable(3)
const doubler = computed(() => number.get() * 2)
const stop = keepAlive(doubler)
// doubler will now stay in sync reactively even when there are no further observers
stop()
// normal behavior, doubler results will be recomputed if not observed but needed, but lazily
const obj = observable({
number: 3,
doubler: function() { return this.number * 2 }
})
const stop = keepAlive(obj, "doubler")
```

Returns **IDisposer** stops this keep alive so that the computed value goes back to normal behavior

## keepAlive

MobX normally suspends any computed value that is not in use by any reaction,
and lazily re-evaluates the expression if needed outside a reaction while not in use.
`keepAlive` marks a computed value as always in use, meaning that it will always fresh, but never disposed automatically.

### Parameters

- `_1`
- `_2`
- `target` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** an object that has a computed property, created by `@computed` or `extendObservable`
- `property` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the property to keep alive
- `computedValue` **IComputedValue&lt;any>** created using the `computed` function

### Examples

```javascript
const obj = observable({
number: 3,
doubler: function() { return this.number * 2 }
})
const stop = keepAlive(obj, "doubler")
const number = observable(3)
const doubler = computed(() => number.get() * 2)
const stop = keepAlive(doubler)
// doubler will now stay in sync reactively even when there are no further observers
stop()
// normal behavior, doubler results will be recomputed if not observed but needed, but lazily
```

Returns **IDisposer** stops this keep alive so that the computed value goes back to normal behavior
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobx-utils",
"version": "5.5.3",
"version": "5.5.4",
"description": "Utility functions and common patterns for MobX",
"main": "mobx-utils.umd.js",
"module": "mobx-utils.module.js",
Expand Down
46 changes: 23 additions & 23 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"version": "1.8.10",
"compilerOptions": {
"target": "es5",
"sourceMap": false,
"declaration": true,
"module": "es6",
"removeComments": false,
"outDir": "../lib/",
"noImplicitAny": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"lib": [
"dom",
"es2015",
"scripthost",
"es2015.promise",
"es2015.generator",
"es2015.iterable"
]
},
"exclude": ["node_modules"]
}
{
"version": "1.8.10",
"compilerOptions": {
"target": "es5",
"sourceMap": false,
"declaration": true,
"module": "es6",
"removeComments": false,
"outDir": "../lib/",
"noImplicitAny": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"lib": [
"dom",
"es2015",
"scripthost",
"es2015.promise",
"es2015.generator",
"es2015.iterable"
]
},
"exclude": ["node_modules"]
}
Loading

0 comments on commit c0c8065

Please sign in to comment.