💾 Archived View for thurk.org › blog › 214.gmi captured on 2023-09-08 at 16:27:43. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-07-22)
-=-=-=-=-=-=-
Last night, my lethargy broke at some point after 19.00, birthing a bit of creative thought concerning the **martenblog** and my problem with **promises**. At first, I believed the solution would be in the *View*. This turned out, eventually, as I bitterly experienced, to be incorrect, as I still could not access (much less *manipulate*) the data that arrived from mongo in the form of a **PromiseArray**. Ie, I still only got a blank array. Many solutions are proposed on *stackoverflow*, but none worked. I just *installed* a (questionably) *new* version of *ember-data*, so, initially, I'll see where that goes.
I found a tidbit of very useful information just now: PromiseProxyMixin[1]. The page has informed me that promises (and, I suppose, promise arrays) can be pending, settled, rejected and fulfilled. If the raw promise array is returned from the controller to the view, I can test whether it is pending, etc. Now, I must be able to *modify* the template dynamically when the promise is fulfilled. Oouh, *baby*.
And I need to retrieve my laundry.
I discovered that I did not add soap the previous time I did laundry (yesterday), so I am redoing it. Fine, eh?
So, I have managed to access the promise array and create the pagination links on the client side. The next step is to make sure it refreshes every time the page is actually **changed**. Yes, sir.
Now for a shower.
1: http://emberjs.com/api/classes/Ember.PromiseProxyMixin.html
@flavigula@sonomu.club
CC BY-NC-SA 4.0