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

feat: add button to query from store in light-js #283

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

adklempner
Copy link
Member

@adklempner adklempner commented Nov 2, 2023

should be merged after #282

fulfills part of #248

@adklempner adklempner force-pushed the adklempner/light-js-store-query branch from 743a644 to 304b31b Compare November 2, 2023 00:43
@weboko weboko marked this pull request as ready for review November 2, 2023 11:55
@weboko weboko requested a review from a team as a code owner November 2, 2023 11:55
@adklempner adklempner force-pushed the adklempner/light-js-store-query branch 2 times, most recently from 9ec4bdb to 3a7da56 Compare November 2, 2023 21:13
let messages = [];
// Each key in messages should be string hash. each value is an obj of class Message
let messages = {};
class Message {
Copy link
Contributor

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

Copy link
Member Author

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

@adklempner adklempner force-pushed the adklempner/light-js-store-query branch from 3a7da56 to f78d4f9 Compare November 3, 2023 23:50
@adklempner adklempner force-pushed the adklempner/light-js-store-query branch from f78d4f9 to e4f4f56 Compare November 3, 2023 23:58
@@ -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 = {};
Copy link
Collaborator

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.

@adklempner adklempner merged commit 73ca3ab into master Nov 7, 2023
9 checks passed
@adklempner adklempner deleted the adklempner/light-js-store-query branch November 7, 2023 16:05
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.

4 participants