Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typed arrays #47

Merged
merged 4 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.iml
.idea/
.vscode/
**/node_modules/
**/reports
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ Main aspects:
* nested objects of the observable graph are observables too
* changes delivered in a __synchronous__ way
* original objects are __cloned__ while turned into `Observable`s
* arrays specifics:
* __arrays__ specifics:
* generic object-like mutations supported
* intrinsic `Array` mutation methods supported: `pop`, `push`, `shift`, `unshift`, `reverse`, `sort`, `fill`, `splice`
* massive mutations delivered in a single callback, usually having an array of an atomic changes
* __typed arrays__ specifics:
* generic object-like mutations supported
* intrinsic `TypedArray` mutation methods supported: `reverse`, `sort`, `fill`, `set`
* massive mutations delivered in a single callback, usually having an array of an atomic changes
* intrinsic mutation methods of `Map`, `WeakMap`, `Set`, `WeakSet` (`set`, `delete`) etc __are not__ observed (see this [issue](https://github.com/gullerya/object-observer/issues/1) for more details)
* following host objects (and their extensions) __are actively checked__ and NOT cloned / turned into observables: `Date`, `Blob`, `Error`

Expand All @@ -43,14 +47,14 @@ For a short preview you may want to play with this [JSFiddle](https://jsfiddle.n

`object-observer` provided as an __ES6 module__.
In `NodeJS` environment, that is not yet fully supporting ES6 modules, use the dedicated distribution as in example below.
> Once `NodeJS` (presumable 13.11.0 going to LTS) will add a full support for ES6 modules, this special distribution will be removed.
> Once `NodeJS` (seemingly 14.x.x going to LTS) will add a full support for ES6 modules, this special distribution will be removed.

```javascript
// browser
import { Observable } from 'dist/object-observer.min.js';

// NodeJS (when NodeJS will fully support ES6 modules syntax - this one will be removed)
let Observable = require('./dist/node/object-observer').Observable;
const Observable = require('./dist/node/object-observer').Observable;
```

# API
Expand Down
Loading