Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(createRecentSearchesPlugin): rewrite docs #469

Merged
merged 3 commits into from
Mar 4, 2021

Conversation

sarahdayan
Copy link
Member

This rewrites the createRecentSearchesPlugin docs.

I've added inline comments on some changes for easier reviewing.

@sarahdayan sarahdayan marked this pull request as ready for review February 25, 2021 16:13
@sarahdayan
Copy link
Member Author

Broken unit tests are caused by 752afd8 which broke the build.

@sarahdayan sarahdayan force-pushed the docs/createRecentSearchesPlugin branch from e852fc7 to f8ae4c8 Compare February 26, 2021 18:25
@sarahdayan sarahdayan force-pushed the docs/createRecentSearchesPlugin branch from 91c418f to 3e29b2e Compare February 26, 2021 18:43
Comment on lines +76 to +80
async getAll(query) {
const items = await RecentSearchesItem.find({});

return search({ query, items, limit: 5 });
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

async is not super democratized in the frontend, it requires special configuration.

Suggested change
async getAll(query) {
const items = await RecentSearchesItem.find({});
return search({ query, items, limit: 5 });
},
getAll(query) {
return RecentSearchesItem.find({}).then((items) => {
return search({ query, items, limit: 5 });
});
},

Copy link
Member Author

@sarahdayan sarahdayan Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many browsers support async and await without transforms. Internet Explorer is the only one that doesn't, but it doesn't support the Promise constructor either so users would need transforms or polyfills for IE 11 anyway.

sarahdayan added a commit that referenced this pull request Mar 2, 2021
* docs(createLocalStorageRecentSearchesPlugin): rewrite docs

* fix(createLocalStorageRecentSearchesPlugin): apply changes from #469
@sarahdayan sarahdayan merged commit b397149 into next Mar 4, 2021
@sarahdayan sarahdayan deleted the docs/createRecentSearchesPlugin branch March 4, 2021 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants