-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add Undo/Redo #149
Add Undo/Redo #149
Conversation
stores/history.ts
Outdated
import { debounce } from '../lib/time.js' | ||
import { current, type LchValue } from './current.js' | ||
|
||
let $undos = atom<LchValue[]>([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have $
in store name in other stores?
If not it is better to keep origin name system.
We can switch to $
in separated PR. I like this idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. I understand it and it was that before. but with prev, I few times was confused is it a variable or a store. and in documentation I saw this $ sign. then I left with undos store and $prev store
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have time, let's migrate to $
when we will finish with this PR
Resolves #148
$prev is needed for storing previous color. I tried to use oldValue from subscribe, but because of debounce, it can be the same as value.$prev initialised with 0 color to avoid checking for null. I set correct first value in subscribe, when oldValue is not passedon cmd + Y in macOS Safari usually opens history, is it okay that now I prevent to open it?