-
-
Notifications
You must be signed in to change notification settings - Fork 969
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
[Question] Avoiding data collision #2680
Comments
I am on it. I will check it asap |
Ok I have spotted a bug here. Attributes will not passed to children components in a each directive. I will fix the compiler output |
This issue was solved in riot@4.0.0-rc.9 thanks for reporting it! |
I've just tried using -> https://gist.github.com/zimt28/6b7886ee7fa42af5d7cc540a7e404b4c reproduces it |
Have you tried? |
Yes, I didn't update the Gist but |
I see 3 pages and I am not sure I understand the problem: I have found initially a riot@4 bug of communication between parent child but now it works everything fine. I can't help you any further here and I don't see any riot bug. Please try posting your issue on stackoverflow providing more info about your browser as well. |
Sorry - I think I failed to describe the actual issue. If you look at your screen video, you see three items on page three: |
@GianlucaGuarini Sorry to ping you again, but could you re-evaluate if it‘s a Riot issue or not? I think we weren‘t talking about the same problem before. |
It's not a Riot.js issue you will have the same problem with any framework. It's an application issue. Please consider updating your code handling your data differently preparing your page chunks before they get passed to your components. I am sorry I can fix here only Riot.js issues but I am not available for consulting. |
I want to use Riot for building dynamic invoices which can have multiple pages.
My app consists of two components:
app
andpage
.app
holds the state and just renders a list ofpage
s and apage
renders a list of items. Each page checks, if it can render the items it was given – if not, it asks to remove an item, until it can show all assigned items:The
app
component then takes the last item of the page and pushes it to the next page:This works quite well, until the items need more than two pages: Some of the items will then disappear. This is probably caused by the
removeItemFromPage
function which reads the current state and sets a modified state, every additional page might call this function at the same time, so changes made between read and update are lost.Question: Is there a way to make sure that the state cannot be changed between read & write?
The whole code can be found here: https://gist.github.com/zimt28/6b7886ee7fa42af5d7cc540a7e404b4c
Thanks!
The text was updated successfully, but these errors were encountered: