From 9dd5f53ed0fcb8f9371c71306df663576a68dff5 Mon Sep 17 00:00:00 2001 From: Jon Wire Date: Wed, 22 Mar 2023 17:21:17 -0500 Subject: [PATCH 1/4] clarified DataStore selective sync reevaluation language --- src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx b/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx index baeca37fb30..e0f19452fe9 100644 --- a/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx +++ b/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx @@ -54,9 +54,9 @@ async function changeSync() { }; ``` -Upon calling `DataStore.start()` (or executing a DataStore operation, e.g., `query`, `save`, `delete`, or `observe`), DataStore will reevaluate the `syncExpressions`. +It's important to remember that calls to `start`, `query`, `save`, `delete`, `observe`, and `observeQuery` will only start DataStore and reevaluated sync expressions if DataStore is not already started. -In the above case, the predicate will contain the value `1`, so all Posts with `rating > 1` will get synced down. +In the example above, `changeSync()` invokes `DataStore.start()` after `DataStore.stop()` has completely finished. This causes sync expressions to be reevaluated. And in this example, when the sync expression is reevaluated, the `rating` variable has been changed to `1`, so all Posts with `rating > 1` will get synced down. Keep in mind: `DataStore.stop()` will retain the local store's existing content. Run `DataStore.clear()` to clear the locally-stored contents. From 2985b464ee3265ff7071bd4f332207b95165daf0 Mon Sep 17 00:00:00 2001 From: Jon Wire Date: Wed, 22 Mar 2023 17:26:24 -0500 Subject: [PATCH 2/4] fixed word tense typo --- src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx b/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx index e0f19452fe9..97cf4d71ff3 100644 --- a/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx +++ b/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx @@ -54,7 +54,7 @@ async function changeSync() { }; ``` -It's important to remember that calls to `start`, `query`, `save`, `delete`, `observe`, and `observeQuery` will only start DataStore and reevaluated sync expressions if DataStore is not already started. +It's important to remember that calls to `start`, `query`, `save`, `delete`, `observe`, and `observeQuery` will only start DataStore and reevaluate sync expressions if DataStore is not already started. In the example above, `changeSync()` invokes `DataStore.start()` after `DataStore.stop()` has completely finished. This causes sync expressions to be reevaluated. And in this example, when the sync expression is reevaluated, the `rating` variable has been changed to `1`, so all Posts with `rating > 1` will get synced down. From e4077b86436baacb2c4b81c34911f9774659f34c Mon Sep 17 00:00:00 2001 From: Jon Wire Date: Wed, 22 Mar 2023 17:28:40 -0500 Subject: [PATCH 3/4] Update src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx Co-authored-by: Rene Brandel <4989523+renebrandel@users.noreply.github.com> --- src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx b/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx index 97cf4d71ff3..78db133abb6 100644 --- a/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx +++ b/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx @@ -54,7 +54,7 @@ async function changeSync() { }; ``` -It's important to remember that calls to `start`, `query`, `save`, `delete`, `observe`, and `observeQuery` will only start DataStore and reevaluate sync expressions if DataStore is not already started. +Calls to `start`, `query`, `save`, `delete`, `observe`, and `observeQuery` will only start DataStore and reevaluate sync expressions if DataStore is not already started. In the example above, `changeSync()` invokes `DataStore.start()` after `DataStore.stop()` has completely finished. This causes sync expressions to be reevaluated. And in this example, when the sync expression is reevaluated, the `rating` variable has been changed to `1`, so all Posts with `rating > 1` will get synced down. From 3996375d3c0d88daca01b46b1552e58007587706 Mon Sep 17 00:00:00 2001 From: Jon Wire Date: Wed, 22 Mar 2023 17:30:06 -0500 Subject: [PATCH 4/4] Update src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx Co-authored-by: Rene Brandel <4989523+renebrandel@users.noreply.github.com> --- src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx b/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx index 78db133abb6..aae4c74ccb2 100644 --- a/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx +++ b/src/fragments/lib/datastore/js/sync/50-selectiveSync.mdx @@ -56,7 +56,7 @@ async function changeSync() { Calls to `start`, `query`, `save`, `delete`, `observe`, and `observeQuery` will only start DataStore and reevaluate sync expressions if DataStore is not already started. -In the example above, `changeSync()` invokes `DataStore.start()` after `DataStore.stop()` has completely finished. This causes sync expressions to be reevaluated. And in this example, when the sync expression is reevaluated, the `rating` variable has been changed to `1`, so all Posts with `rating > 1` will get synced down. +In the example above, `changeSync()` invokes `DataStore.start()` after `DataStore.stop()` has completely finished. This causes sync expressions to be reevaluated. Subsequently, when the sync expression is reevaluated, the `rating` variable has been changed to `1`, so all Posts with `rating > 1` will get synced down. Keep in mind: `DataStore.stop()` will retain the local store's existing content. Run `DataStore.clear()` to clear the locally-stored contents.