parse 3.3.2-alpha.1 → 3.4.0-alpha.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v3.3.2-alpha.1
2
+ * Parse JavaScript SDK v3.4.0-alpha.1
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -699,7 +699,7 @@ var config
699
699
  SERVER_AUTH_TOKEN: null,
700
700
  LIVEQUERY_SERVER_URL: null,
701
701
  ENCRYPTED_KEY: null,
702
- VERSION: 'js' + "3.3.2-alpha.1",
702
+ VERSION: 'js' + "3.4.0-alpha.1",
703
703
  APPLICATION_ID: null,
704
704
  JAVASCRIPT_KEY: null,
705
705
  MASTER_KEY: null,
@@ -5612,8 +5612,6 @@ var Parse = {
5612
5612
  /*: string*/
5613
5613
  ) {
5614
5614
  Parse._initialize(applicationId, javaScriptKey);
5615
-
5616
- _EventuallyQueue.default.poll();
5617
5615
  },
5618
5616
  _initialize: function (applicationId
5619
5617
  /*: string*/
@@ -5868,14 +5866,32 @@ Parse._getInstallationId = function () {
5868
5866
  };
5869
5867
  /**
5870
5868
  * Enable pinning in your application.
5871
- * This must be called before your application can use pinning.
5869
+ * This must be called after `Parse.initialize` in your application.
5872
5870
  *
5871
+ * @param [polling] Allow pinging the server /health endpoint. Default true
5872
+ * @param [ms] Milliseconds to ping the server. Default 2000ms
5873
5873
  * @static
5874
5874
  */
5875
5875
 
5876
5876
 
5877
5877
  Parse.enableLocalDatastore = function () {
5878
- Parse.LocalDatastore.isEnabled = true;
5878
+ var polling = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
5879
+ var ms
5880
+ /*: number*/
5881
+ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;
5882
+
5883
+ if (!Parse.applicationId) {
5884
+ console.log("'enableLocalDataStore' must be called after 'initialize'");
5885
+ return;
5886
+ }
5887
+
5888
+ if (!Parse.LocalDatastore.isEnabled) {
5889
+ Parse.LocalDatastore.isEnabled = true;
5890
+
5891
+ if (polling) {
5892
+ _EventuallyQueue.default.poll(ms);
5893
+ }
5894
+ }
5879
5895
  };
5880
5896
  /**
5881
5897
  * Flag that indicates whether Local Datastore is enabled.