entangld 2.3.1 → 2.4.1

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.
@@ -0,0 +1,26 @@
1
+ name: Mocha Tests
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ jobs:
9
+ # Runs on linux
10
+ test-linux:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@v2
16
+
17
+ - name: Set up Node.js
18
+ uses: actions/setup-node@v2
19
+ with:
20
+ node-version: 12
21
+
22
+ - name: Install dependencies
23
+ run: npm install
24
+
25
+ - name: Run Mocha tests on Linux
26
+ run: npm test
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
@@ -2,6 +2,10 @@
2
2
 
3
3
  Synchronized key-value stores with RPCs and pub/sub events. Works over sockets (try it with [Sockhop](https://www.npmjs.com/package/sockhop "Sockhop on NPM")!)
4
4
 
5
+ ## Tests
6
+
7
+ ![example workflow](https://github.com/Daxbot/entangld/actions/workflows/mocha-tests.yml/badge.svg)
8
+
5
9
  ## Examples
6
10
  Basic use:
7
11
  ```js
@@ -12,7 +16,7 @@ Basic use:
12
16
  e.get("number.six").then((val)=>{}); // val==6
13
17
 
14
18
  // Functions as values
15
- e._deref_mode=true;
19
+ e._deref_mode=true; // Or pass to constructor: new Entangld({ deref_mode: true });
16
20
  e.set("number.seven",()=>{ return 7;});
17
21
  e.get("number").then((val)=>{}); // val => { six:6, seven, 7}
18
22
 
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 == undefined ? false : deref_mode;
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.1",
4
4
  "description": "Synchronized key-value stores with RPCs and events",
5
5
  "main": "index.js",
6
6
  "jshintConfig": {