question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Review of flush defaults

See original GitHub issue

This is a review of the current usage of flush timing in vueuse. I think I understand better the reason the previous default for useRefHistory was 'sync' now. If we would have called this composable watchRefHistory, I think it will be easier to see why I pushed for ‘pre’. If the name would be computedRefHistory, then 'sync' would be better. I wonder if using “watch” as prefix instead of “use” is not better, but maybe if the documentation is clear this is not a problem.

controlledComputed

controlledComputed is using flush: 'sync' and it is not configurable, I think this is correct because it is the way computed works.

syncRef, bySyncRef

syncRef defaults to 'sync', but in the docs it says the default is ‘post’. Because the name is syncRef, it is kind of hard to not use ‘sync’ as the default here. I think it also should behave like computed. Also, bySyncRef is not configurable and is using 'sync' I can send a PR to change the default in the docs to 'sync'

useStorage

useStorage is using 'post' as its default and it is not configurable. Was 'post' used because there was a limitation about making flush configurable for this one?

when

when is using 'sync' as its default, but it looks more like a watcher to me. I think we could change its default to ‘pre’ to align it to the watch API

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
antfucommented, Nov 11, 2020

No problem. I don’t care about merge or rebase as long as the final generated changelogs are meaningful. And yeah PR will better which helps me remember to review.

0reactions
patak-devcommented, Nov 11, 2020

Pushed the section to the doc @antfu https://github.com/antfu/vueuse/commit/dfc72eca3b2b58607fcef58bf48fc702fa5c1958 But looks like I pushed a merge commit, I do not know if I can rebase it, truly sorry about it 😦 I’ll do a PR even for adding docs from now on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flush review: Stop letting human faeces go down the toilet
Bryn Nelson's extraordinary book asks why we let a vital natural resource, human faeces, get flushed away when we could be using it...
Read more >
Flush Book Review | Common Sense Media
Part mystery, part caper, this environmental novel has action, humor, a bit of suspense, and some interesting characters. Flush is like a Hardy ......
Read more >
Toilet tests flush out the best models - Consumer Reports
Our latest evaluations include a drain-line carry test that measures how far the flushed water and simulated waste move in one, two, and...
Read more >
gerrit flush-caches - gerrit-review
Clear an in-memory cache, forcing Gerrit to reconsult the ground truth when it needs the information again. Flushing a cache may be necessary...
Read more >
example-of-a-flush-setting | Education
... Scale | A Guide to Gemstone Hardness The Mohs Scale · Jewelry Glossary | Definitions of Settings Terminology Glossary. Over 2,300+ Reviews...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found