entangld 2.3.1 → 2.4.0

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.hbs CHANGED
@@ -12,7 +12,7 @@ Basic use:
12
12
  e.get("number.six").then((val)=>{}); // val==6
13
13
 
14
14
  // Functions as values
15
- e._deref_mode=true;
15
+ e._deref_mode=true; // Or pass to constructor: new Entangld({ deref_mode: true });
16
16
  e.set("number.seven",()=>{ return 7;});
17
17
  e.get("number").then((val)=>{}); // val => { six:6, seven, 7}
18
18
 
package/README.md CHANGED
@@ -12,7 +12,7 @@ Basic use:
12
12
  e.get("number.six").then((val)=>{}); // val==6
13
13
 
14
14
  // Functions as values
15
- e._deref_mode=true;
15
+ e._deref_mode=true; // Or pass to constructor: new Entangld({ deref_mode: true });
16
16
  e.set("number.seven",()=>{ return 7;});
17
17
  e.get("number").then((val)=>{}); // val => { six:6, seven, 7}
18
18
 
package/lib/Datastore.js CHANGED
@@ -20,7 +20,9 @@ const {
20
20
  */
21
21
  class Entangld extends EventEmitter {
22
22
 
23
- constructor() {
23
+ constructor({
24
+ deref_mode = false,
25
+ }={}) {
24
26
  super();
25
27
 
26
28
  this._stores = new Map();
@@ -35,7 +37,7 @@ class Entangld extends EventEmitter {
35
37
  // its children to see if they are functions. We will then call those
36
38
  // functions and return their values. This should be the default
37
39
  // behavior, but it is rather expensive. TODO
38
- this._deref_mode = false;
40
+ this._deref_mode = deref_mode ?? false;
39
41
  }
40
42
 
41
43
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "entangld",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "Synchronized key-value stores with RPCs and events",
5
5
  "main": "index.js",
6
6
  "jshintConfig": {