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

Real time map #299

Merged
merged 8 commits into from
Sep 22, 2024
Merged

Real time map #299

merged 8 commits into from
Sep 22, 2024

Conversation

Reshex
Copy link
Contributor

@Reshex Reshex commented Aug 12, 2024

Real time map changes (still not finished)

Copy link
Collaborator

@vladbyk89 vladbyk89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check if your implementation works?
On my local computer it didn't.

Comment on lines 89 to 97
unsubscribe = await listenToChildStatements(dispatch, statement.statementId, (childStatements) => {
setSubStatements(childStatements);

const topResult = sortStatementsByHirarrchy([
statement,
...childStatements.filter((state) => isOptionFn(state) || state.statementType === StatementType.question),
])[0];

setResults(topResult);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create the callback function outside of the listenToChildStatements props to improve readability.

@Reshex
Copy link
Contributor Author

Reshex commented Aug 13, 2024

Did you check if your implementation works? On my local computer it didn't.

No it doesn't work properly yet, I've asked for Tal's advice in what should i do in order for it to work. The problem is that when we add a new statement only the new statement is added in real time, the whole map is somehow missing and only on second rendering we get the expected result like before.

@talyaron
Copy link
Owner

Lets talk about it today

@talyaron talyaron merged commit 782ec39 into talyaron:dev Sep 22, 2024
1 check passed
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.

3 participants