Giter Club home page Giter Club logo

Comments (4)

p69 avatar p69 commented on June 28, 2024

Hi, could you please be more specific what would you like to achieve?
Do you want to update some widgets inside ProgramWidget? Or do you want to update specific ProgramWidget from the other widgets?

from dartea.

ValeriusGC avatar ValeriusGC commented on June 28, 2024
  • There are 2 screens, 2 models. And 2 db-tables backstage:
    • ActionScreen (AS), ActionModel (AM) with its messages, ActionTable (AT)
    • HistoryScreen (HS, HistoryModel (HM) with its messages, HistoryTable (HT)
    • Of course there are ProgramWidget on both of widgets, and DarteaMessagesBus on the root one
  • In the static situation screens keep their state between switching and this is OK
  • Changing Action* affects History* too, so both tables change and from AM i want send message or something to HM and HT about that
    But when HS is hidden no messages reach it from outer model AM and when i switch to it i see previous unchanged state

So, the question is: is there a solution within this library to transmit messages to hidden models?


BTW, just for information )))
Earlier i used to code for Android on Java/Kotline and use Moxy library. That library was keeping messages queue with a various behaviour and lifetime depending on some key.

from dartea.

p69 avatar p69 commented on June 28, 2024

Hey, sorry for long response.
Unfortunately it's not possible to do it in that way. Communication between ProgramWidgets is not possible if one of them is out of the tree.
I think you should reconsider your Model and Domain layer. Generally you shouldn't face such problems if you do it in a right way.
For example when you mutate your Actions model, I guess, you need to persist some data somehow. And when you show History screen you can read latest data from persistent storage.
It's not necessary to use persistent storage, it can be in memory data structure, but the idea is the same: update your data and initialize your widget with the latest changes.

I hope that helps. Any way you can ask anything if it's still unclear.

from dartea.

ValeriusGC avatar ValeriusGC commented on June 28, 2024

Hey, sorry for long response.
...
For example when you mutate your Actions model, I guess, you need to persist some data somehow. And when you show History screen you can read latest data from persistent storage.
It's not necessary to use persistent storage, it can be in memory data structure, but the idea is the same: update your data and initialize your widget with the latest changes.
...

Thanks for replying me.
Of course I could and of course i will it in this way or somehow.
But... The fact is it would be useful when View had information that something happened when it was offline. Since the Model has a long life cycle, so why not introduce the ability to store such information into it until the View appears again. I mean inside Dartea as part of kernel.

from dartea.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.