@nymphjs/client 1.0.0-alpha.2 → 1.0.0-alpha.20

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/CHANGELOG.md CHANGED
@@ -3,6 +3,90 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.20](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.19...v1.0.0-alpha.20) (2021-11-24)
7
+
8
+ **Note:** Version bump only for package @nymphjs/client
9
+
10
+ # [1.0.0-alpha.19](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2021-11-18)
11
+
12
+ ### Features
13
+
14
+ - update smui and other packages to latest versions ([2465340](https://github.com/sciactive/nymphjs/commit/24653400d887bc04c41c3c4ee0c73ce2f2289e0d))
15
+
16
+ # [1.0.0-alpha.18](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2021-11-09)
17
+
18
+ ### Features
19
+
20
+ - move entity sorter to its own package and add more features ([ef57460](https://github.com/sciactive/nymphjs/commit/ef57460d88c927a0e3a44b0071f553f1c92708bc))
21
+
22
+ # [1.0.0-alpha.17](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2021-10-14)
23
+
24
+ **Note:** Version bump only for package @nymphjs/client
25
+
26
+ # [1.0.0-alpha.16](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2021-10-14)
27
+
28
+ ### Bug Fixes
29
+
30
+ - don't ignore built files in npm packages ([7d688db](https://github.com/sciactive/nymphjs/commit/7d688dbec362f1f71fb451a1d0dbcaecc15d99fc))
31
+
32
+ # [1.0.0-alpha.15](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2021-10-14)
33
+
34
+ **Note:** Version bump only for package @nymphjs/client
35
+
36
+ # [1.0.0-alpha.14](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2021-10-14)
37
+
38
+ **Note:** Version bump only for package @nymphjs/client
39
+
40
+ # [1.0.0-alpha.13](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2021-10-14)
41
+
42
+ **Note:** Version bump only for package @nymphjs/client
43
+
44
+ # [1.0.0-alpha.12](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2021-10-13)
45
+
46
+ **Note:** Version bump only for package @nymphjs/client
47
+
48
+ # [1.0.0-alpha.11](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2021-10-13)
49
+
50
+ **Note:** Version bump only for package @nymphjs/client
51
+
52
+ # [1.0.0-alpha.10](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2021-10-12)
53
+
54
+ **Note:** Version bump only for package @nymphjs/client
55
+
56
+ # [1.0.0-alpha.9](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2021-10-12)
57
+
58
+ **Note:** Version bump only for package @nymphjs/client
59
+
60
+ # [1.0.0-alpha.8](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2021-10-12)
61
+
62
+ **Note:** Version bump only for package @nymphjs/client
63
+
64
+ # [1.0.0-alpha.7](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2021-10-05)
65
+
66
+ **Note:** Version bump only for package @nymphjs/client
67
+
68
+ # [1.0.0-alpha.6](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2021-10-05)
69
+
70
+ **Note:** Version bump only for package @nymphjs/client
71
+
72
+ # [1.0.0-alpha.5](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2021-09-30)
73
+
74
+ **Note:** Version bump only for package @nymphjs/client
75
+
76
+ # [1.0.0-alpha.4](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2021-09-27)
77
+
78
+ ### Features
79
+
80
+ - use new instances of nymph for server and pubsub requests ([0c18fab](https://github.com/sciactive/nymphjs/commit/0c18faba2b55fe82c16806d221fc54d2cd42c992))
81
+
82
+ # [1.0.0-alpha.3](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2021-09-22)
83
+
84
+ ### Features
85
+
86
+ - allow multiple instances of Nymph Client ([81eacd7](https://github.com/sciactive/nymphjs/commit/81eacd7caff6f3c209d7d6dbfdac0414a1857c6d))
87
+ - migrate Tilmeld Client to new instance based Nymph Client ([dffe83b](https://github.com/sciactive/nymphjs/commit/dffe83b3900171a56d703cd491536b5d21360198))
88
+ - move to fully instance based design, no more globals ([c036220](https://github.com/sciactive/nymphjs/commit/c0362209b90a475b8b85269a829b0ec6bed4465f))
89
+
6
90
  # [1.0.0-alpha.2](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2021-09-21)
7
91
 
8
92
  ### Features
package/README.md CHANGED
@@ -12,50 +12,31 @@ npm install --save @nymphjs/client
12
12
 
13
13
  This package is the Nymph client for browsers. You can find UMD in `dist`, or TS source in `src`. There is also a **[Node.js client](https://github.com/sciactive/nymphjs/packages/client-node)**.
14
14
 
15
- ## Setup
16
-
17
- ```html
18
- <head>
19
- <!-- Nymph setup -->
20
- <script>
21
- NymphOptions = {
22
- restUrl: 'https://yournymphrestserver/path/to/your/endpoint',
23
- pubsubUrl: 'wss://yournymphpubsubserver',
24
- };
25
- </script>
26
- <!-- End Nymph setup -->
27
-
28
- <!-- Old school JS -->
29
- <script src="node_modules/nymph-client/dist/NymphClient.js"></script>
30
- <script src="path/to/your/entity/js/Todo.js"></script>
31
- <!-- End Old school JS -->
32
- </head>
33
- ```
34
-
35
15
  ## Usage
36
16
 
37
- For detailed docs, check out the User Guide on the website:
38
-
39
- - [Entity Class](https://nymph.io/user-guide/entity-class)
40
- - [Entity Querying](https://nymph.io/user-guide/entity-querying)
41
- - [Extending the Entity Class](https://nymph.io/user-guide/extending-the-entity-class)
42
- - [Subscribing to Queries](https://nymph.io/user-guide/subscribing-to-queries)
43
-
44
17
  Here's an overview:
45
18
 
46
- ```js
19
+ ```ts
47
20
  import { Nymph, PubSub } from '@nymphjs/client';
48
21
  import Todo from 'Todo';
49
22
 
23
+ const nymphOptions = {
24
+ restUrl: 'https://yournymphrestserver/path/to/your/endpoint',
25
+ pubsubUrl: 'wss://yournymphpubsubserver',
26
+ };
27
+ const nymph = new Nymph(nymphOptions);
28
+ const pubsub = new PubSub(nymphOptions, nymph);
29
+ nymph.addEntityClass(Todo);
30
+
50
31
  // Now you can use Nymph and PubSub.
51
32
  const myTodo = new Todo();
52
33
  myTodo.name = 'This is a new todo!';
53
34
  myTodo.done = false;
54
35
  await myTodo.$save();
55
36
 
56
- let allMyTodos = await Nymph.getEntities({ class: Todo });
37
+ let allMyTodos = await nymph.getEntities({ class: Todo });
57
38
 
58
- let subscription = PubSub.subscribeWith(myTodo, () => {
39
+ let subscription = pubsub.subscribeWith(myTodo, () => {
59
40
  // When this is called, the entity will already contain new data from the
60
41
  // publish event. If the entity is deleted, the GUID will be set to null.
61
42
  if (myTodo.guid != null) {
@@ -71,7 +52,7 @@ let subscription = PubSub.subscribeWith(myTodo, () => {
71
52
  // Subscribing to a query.
72
53
  let todos = [];
73
54
  let userCount = 0;
74
- let subscription = PubSub.subscribeEntities(
55
+ let subscription = pubsub.subscribeEntities(
75
56
  {
76
57
  class: Todo.class,
77
58
  },
@@ -87,7 +68,7 @@ let subscription = PubSub.subscribeEntities(
87
68
  // This takes an existing array of entities and either updates it to match
88
69
  // another array, or performs actions from a publish event object to update
89
70
  // it.
90
- PubSub.updateArray(todos, update);
71
+ pubsub.updateArray(todos, update);
91
72
 
92
73
  // `todos` is now up to date with the latest publishes from the server.
93
74
  },