Skip to content

Commit 79bd8f7

Browse files
th3brinkphillwigginsmregandla
authored
Fixed the Parse().initialize's return value (#307)
* Release/1.0.26 - Update docs * Updated Live Queries related documentation (#301) * Fixed the parse initialize method Parse().initialize returns a new instantiation of the Parse class, but it should return the initialized instance. Co-authored-by: Phill Wiggins <[email protected]> Co-authored-by: mregandla <[email protected]>
1 parent add619e commit 79bd8f7

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
## 1.0.26
2+
13
## 1.0.25
4+
Update dependencies
25

36
## 1.0.24
47
Fixed lint

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Want to get involved? Join our Slack channel and help out! (http://flutter-parse
1313
To install, either add to your pubspec.yaml
1414
```yml
1515
dependencies:
16-
parse_server_sdk: ^1.0.25
16+
parse_server_sdk: ^1.0.26
1717
```
1818
or clone this repository and add to your project. As this is an early development with multiple contributors, it is probably best to download/clone and keep updating as an when a new feature is added.
1919
@@ -330,7 +330,7 @@ You’ll get the LiveQuery events through this subscription.
330330
The first time you call subscribe, we’ll try to open the WebSocket connection to the LiveQuery server for you.
331331

332332
```dart
333-
await liveQuery.subscribe(query);
333+
Subscription subscription = await liveQuery.client.subscribe(query);
334334
```
335335

336336
__Event Handling__
@@ -340,7 +340,7 @@ __Create event__
340340
When a new ParseObject is created and it fulfills the QueryBuilder you subscribe, you’ll get this event.
341341
The object is the ParseObject which was created.
342342
```dart
343-
liveQuery.on(LiveQueryEvent.create, (value) {
343+
subscription.on(LiveQueryEvent.create, (value) {
344344
print('*** CREATE ***: ${DateTime.now().toString()}\n $value ');
345345
print((value as ParseObject).objectId);
346346
print((value as ParseObject).updatedAt);
@@ -356,7 +356,7 @@ When an existing ParseObject which fulfills the QueryBuilder you subscribe is up
356356
QueryBuilder before and after changes), you’ll get this event.
357357
The object is the ParseObject which was updated. Its content is the latest value of the ParseObject.
358358
```dart
359-
liveQuery.on(LiveQueryEvent.update, (value) {
359+
subscription.on(LiveQueryEvent.update, (value) {
360360
print('*** UPDATE ***: ${DateTime.now().toString()}\n $value ');
361361
print((value as ParseObject).objectId);
362362
print((value as ParseObject).updatedAt);
@@ -372,7 +372,7 @@ When an existing ParseObject’s old value does not fulfill the QueryBuilder but
372372
you’ll get this event. The object is the ParseObject which enters the QueryBuilder.
373373
Its content is the latest value of the ParseObject.
374374
```dart
375-
liveQuery.on(LiveQueryEvent.enter, (value) {
375+
subscription.on(LiveQueryEvent.enter, (value) {
376376
print('*** ENTER ***: ${DateTime.now().toString()}\n $value ');
377377
print((value as ParseObject).objectId);
378378
print((value as ParseObject).updatedAt);
@@ -388,7 +388,7 @@ When an existing ParseObject’s old value fulfills the QueryBuilder but its new
388388
you’ll get this event. The object is the ParseObject which leaves the QueryBuilder.
389389
Its content is the latest value of the ParseObject.
390390
```dart
391-
liveQuery.on(LiveQueryEvent.leave, (value) {
391+
subscription.on(LiveQueryEvent.leave, (value) {
392392
print('*** LEAVE ***: ${DateTime.now().toString()}\n $value ');
393393
print((value as ParseObject).objectId);
394394
print((value as ParseObject).updatedAt);
@@ -403,7 +403,7 @@ __Delete event__
403403
When an existing ParseObject which fulfills the QueryBuilder is deleted, you’ll get this event.
404404
The object is the ParseObject which is deleted
405405
```dart
406-
liveQuery.on(LiveQueryEvent.delete, (value) {
406+
subscription.on(LiveQueryEvent.delete, (value) {
407407
print('*** DELETE ***: ${DateTime.now().toString()}\n $value ');
408408
print((value as ParseObject).objectId);
409409
print((value as ParseObject).updatedAt);
@@ -420,7 +420,7 @@ After that, you won’t get any events from the subscription object and will clo
420420
LiveQuery server.
421421

422422
```dart
423-
await liveQuery.unSubscribe();
423+
liveQuery.client.unSubscribe(subscription);
424424
```
425425

426426
## Users

lib/parse_server_sdk.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class Parse {
135135

136136
_hasBeenInitialized = true;
137137

138-
return Parse();
138+
return this;
139139
}
140140

141141
bool hasParseBeenInitialized() => _hasBeenInitialized;

lib/src/base/parse_constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
part of flutter_parse_sdk;
22

33
// Library
4-
const String keySdkVersion = '1.0.25';
4+
const String keySdkVersion = '1.0.26';
55
const String keyLibraryName = 'Flutter Parse SDK';
66

77
// End Points

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: parse_server_sdk
22
description: Flutter plugin for Parse Server, (https://parseplatform.org), (https://back4app.com)
3-
version: 1.0.25
3+
version: 1.0.26
44
homepage: https://github.com/phillwiggins/flutter_parse_sdk
55
author: PhillWiggins <[email protected]>
66

0 commit comments

Comments
 (0)