Whether the solution focuses on back-end, front-end or if it's full stack. With this iteration, there're some of any typed object, but it's a tradeoff.So, I defined lots of types for handling it and let a map for store it's actions for access on runtime.so in the code side, it looks ugly, always attach as any keyword behind the redux state. Want to create reducers with iterator, but if I create like that, redux store's name and it's actions would be selected at runtime.Research and study would help this quite easy.but I don't have any experiences of this hooks, so whenever I tried to use hooks in the Container component or in the click handlers, it displays an error. It looks quite simple and awesome, so applied to this solution.With the redux store update, some kind of perspectives, evert tick occured actions, progress updation, item's state changes seems that don't need to redrawing all the items, so I used mo and only change it's value, not make a deep copied object.That last updated time only concerns for the calculation of offlined revenue, so I'll put it into that time.I did let the update of time would be held in updating money time.Each tick, it updates it's accessed data, data status, also with updated time.It seems that too many data storing to localStorage.After mostly implemented this sim, I started refactoring with it.Reduce number of calls for synchronizing time So it's a quite easy issue, if I googled the method, and notifying the updates.From Typescript 2.9, supports JSON import.Getting staticdata with XHR seems not good, so I found.But it seems not good, so organize a JSON and load it with XHR.So, first I tried a javasript with it's data.Of course, organizing staticdata is important and it's only frontend side application, so, I should have to find the way to store staticdata.So, final answer is that, from last updated money update time, each business item will calculate how many times they could be run, and remains will be replaced as it's progress.but that saving cost seems too high, and if it's stored at backend, network traffic issue would be great. so I tried to store progress of each business item ande each time.Long duration item case, it will resume specific progress, for example, if there were a item has it's duration would be 1 hour, and offlined about 30mins, and next log-in, it'll start from 50% of progress without earned any money.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |