« first day (4619 days earlier)      last day (330 days later) » 

7:52 AM
I thought Task, Future, and Promise are basically the same
 
8:10 AM
hey guys since AFAIK it is not ok to ask "best practice" questions, is it ok to ask a question which asks "can something go wrong if I use approach X" ? Indeed there is answer that certain features won't work if you use "approach X". So I am trying to figure out how to formulate the question so that it is on topic.
 
 
1 hour later…
9:24 AM
Decided to ask about on this in meta - never mind. Sorry if took your time
 
 
1 hour later…
10:42 AM
@GiorgiMoniava Yes, provided you can formulate a question that can be objectively answered (in a manner of "what are the trade-offs of doing X"), it should be fine. However, the post will likely get contentious regardless - unfortunately, there is no community consensus regarding how to treat such posts. But if you are able to formulate the question that it can objectively be answered, and it still gets closed, feel free to bring it up on meta, and if it's good, it'll get reopened eventually.
Do note, though, that there is a general moderation and curation strike underway, so there's no guarantee you'll get a lot of engagement.
 
11:09 AM
@Wietlol Promise signifies a potential result which isn't here yet. Task/Future you can more directly control the async computation that's happening. There is a large overlap, granted, but also direct differences in the level of granularity. A promise is as I said, just the result. If you order a pizza and get a number that gets called eventually - that's a promise. You have no control how and when it finishes.
A task you can more directly control, like you can create it in a stopped state then only execute it later.
So, a Task represent a whole async computation, not just the result.
 
@VLAZ-onstrike- sounds like Task and Future are then exactly the same as a Promise
all 3 are a wrapper object telling that at some point, a process will finish with a result of a certain type
each of those also provides a way to control how it behaves if you are the one managing the promise/task/future
when I do new Promise(...) I specify how it behaves and when it finishes
for example with new Promise(r => setTimeout(r, 1_000))
 
 
3 hours later…
1:56 PM
@OlegValteriswithUkraine Yes it was objectively answered by showing examples of what can go wrong if you use "approach X"
Also it was about existing question which was already well received, just I was thinking if it was needed to reword it. I guess I will leave it like that. Thanks
 
2:35 PM
@GiorgiMoniava ah, if it's about an existing question, and there is no controversy yet, then it's all good, you don't have to reword anything. As long as it can be answered with facts, it's on topic. Unfortunately, the "opinion-based" close reason is sometimes misused to close anything remotely resembling a question asking for opinions, but that normally can be dealt with on Meta.
 
3:27 PM
@OlegValteriswithUkraine Yeah, in this case someone could have said it is too broad because it is the kind of question "Can something go wrong if I use approach X", but I will leave it like this. It has concrete answer with concrete code.
 
 
4 hours later…
7:12 PM
 
 
2 hours later…
9:17 PM
so, my state is tiered. i have app state, and then 3 separate views that the app renders that can each have their own state and manage a subset of the properties of the entire app
all data for the app comes from a bluetooth connection managed by the appstate
therefore... i have no way of separating the data between the different states that i can think of, because they need to persist at the app level, not the view level
(view being a rather poor descriptor... page, or tab, level)
in a sense, i need a detached state that i can rely on for each tab
that's something i often did in react apps, but not something i've ever done in flutter
there's stateless and stateful widgets, but not widgetless states
 
9:32 PM
@KevinB Maybe ask in Android chat.stackoverflow.com/rooms/15/android idk anything about Flutter
sometimes they are helpful
 
i think i'm cooking up a solution
 
state management is often a pain point in learning new UI frameworks
 
there's a simple route,i just don't like it.
keeping everything in appstate
that's just a nightmare to maintain, having hundreds of properties with getters/setters
 
does everything really need to be global?
 
it's all "set" by being retrieved from the device in a single command, so it all comes in at once on app initialization
technically, i could pass this incoming data to each view when it is rendered, then have that view parse it and pull only the bits it needs to work with and handle the logic there
that does though one add one complication: the moment anything changes, that data is stale
i'd need to re-request it any time i change views
hmm.
 
9:41 PM
I mean if multiple views need all data then the state needs to move up a level
 
what's the harm in just requesting it during view init every time
 
if that means global state, then it's global state
 
each view grabs what it needs from it and then handles it's own logic
 
You can still organize global state tho
 
global state will still need to exist, that's where the connection is and where my "sendMessage" command is, etc
also where receiving messages occurs
 
9:44 PM
You can't do some type of data store
Like MobX
 
that's what i want
that could work
 
 
1 hour later…
11:11 PM
!!choose mage or rogue
 
mage
 
@KevinB does that satisfy you? Did James pick the correct one? :)
 
not sure yet
 
Lol, so this is James choosing one for you then?
 
11:28 PM
possibly, still waiting for vortex to update
 
Ok then lol. Guess you’ll have to wait.
 

« first day (4619 days earlier)      last day (330 days later) »