-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: add button to query from store in light-js #283
Conversation
743a644
to
304b31b
Compare
9ec4bdb
to
3a7da56
Compare
examples/light-js/index.html
Outdated
let messages = []; | ||
// Each key in messages should be string hash. each value is an obj of class Message | ||
let messages = {}; | ||
class Message { |
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.
seems cumbersome - you can just store object { text, timestamp }
and make a string during rendering
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.
Removed class Message
and replaced with a regular object
3a7da56
to
f78d4f9
Compare
f78d4f9
to
e4f4f56
Compare
@@ -91,12 +100,19 @@ <h2>Remote Peers</h2> | |||
const ContentTopic = "/js-waku-examples/1/chat/utf8"; | |||
const decoder = createDecoder(ContentTopic); | |||
const encoder = createEncoder({ contentTopic: ContentTopic }); | |||
let messages = []; | |||
// Each key is a unique identifier for the message. Each value is an obj { text, timestamp } | |||
let messages = {}; |
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.
using a Map
might makes your life easier in terms of iterating through.
should be merged after #282
fulfills part of #248