Skip to content

Commit

Permalink
Merge pull request #86 from morrys/fix-relay-v11-purge
Browse files Browse the repository at this point in the history
fix relay purge notify
  • Loading branch information
morrys authored Apr 27, 2021
2 parents c480a4b + 8416d31 commit ad808dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/relay-offline/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wora/relay-offline",
"version": "5.0.0",
"version": "5.0.1",
"keywords": [
"wora",
"cache-persist",
Expand Down
2 changes: 1 addition & 1 deletion packages/relay-store/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wora/relay-store",
"version": "5.0.0",
"version": "5.0.1",
"keywords": [
"cache",
"wora",
Expand Down
4 changes: 3 additions & 1 deletion packages/relay-store/src/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export class Store extends RelayModernStore {

public purge(): Promise<void[]> {
const updateRecords = (this as any).__getUpdatedRecordIDs();
Object.keys((this as any).getSource().toJSON()).forEach((key) => (updateRecords[key] = true));
Object.keys((this as any).getSource().toJSON()).forEach((key) => {
updateRecords.add(key);
});
this._cache.purge();
return Promise.all([this._cache.flush(), (this as any)._recordSource.purge()]).then((result) => {
this.notify();
Expand Down

0 comments on commit ad808dc

Please sign in to comment.