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

クライアント内でノートのデータを一元的に管理する #7910

Open
tamaina opened this issue Oct 24, 2021 · 7 comments
Open
Labels
✨Feature This adds/improves/enhances a feature

Comments

@tamaina
Copy link
Contributor

tamaina commented Oct 24, 2021

Summary

受信したノートのデータを、ノートマネージャクラスにより管理する

@tamaina tamaina added the ✨Feature This adds/improves/enhances a feature label Oct 24, 2021
@syuilo
Copy link
Member

syuilo commented Oct 24, 2021

なんでそうしなかったか理由を思い出し中

@syuilo
Copy link
Member

syuilo commented Oct 24, 2021

「表示されていなくてもキャプチャする」のと「クライアントでノートをクラス化」ってそんなに関係ないかも

@syuilo
Copy link
Member

syuilo commented Oct 24, 2021

いやクラスかするとDOMとして存在しなくてもキャプチャできるとかそんな感じか

@syuilo
Copy link
Member

syuilo commented Oct 24, 2021

負荷が心配ではある

@tamaina
Copy link
Contributor Author

tamaina commented Oct 24, 2021

負荷

Vueを消すときに現状と同じようにキャプチャ解除するのを忘れなければ大丈夫なハズ…

@syuilo
Copy link
Member

syuilo commented Oct 26, 2021

note / detailed-note みたいな似たようなコンポーネント間で処理を使い回せるから便利そう
あとComposition APIと相性が良さそう

@tamaina tamaina changed the title クライアントでノートをクラス化し、表示されていなくてもキャプチャするように クライアント内でノートのデータを一元的に管理する Jul 26, 2023
@tamaina
Copy link
Contributor Author

tamaina commented Jul 26, 2023

今手をつける気分になっている

  • ノートがストリーミングでやってきたら、とりあえずマネージャにデータを突っ込む(set(Note))
  • 使う時はget(noteId)する、Refが返ってくる
  • noteUpdatedを使いたい場合はcapture(noteId)を呼び出す、onUnmountedなどでdecaptureが必要
    マネージャはキャプチャされた数を把握する、captureでインクリメント、decaptureでデクリメント
  • アップデートは全てnoteUpdatedで降ってくるので自分でアップデートはしない

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feature This adds/improves/enhances a feature
Projects
Development

Successfully merging a pull request may close this issue.

2 participants