×

Is it common practice to do calculations and store objects in an Angular front-end? by [deleted] in Angular2

[–]MitchellNZ 6 points7 points  (0 children)

When dealing with data in front-end, it should be thought of as convenience based. You may do calculations here for the sake for convenience and display purposes, but it will be only for that. Any “real” work should be done in the backend.

For example; if you take a web based shopping cart, you may add multiple items and sum them to display a total value. But you would never use that total value as the “real” amount to pay (they could just open the dev tools and change it or some other form of manipulation). You would pass the shopping cart items to the backend, where it would pull the actual prices from the database again and re-calculate as a source of truth for the total.

As for storing data during workings, I think it depends on the scope.. if you expect the user may want to leave half way through, give them the option to “save for later” which may save an unfinished state to the backend for later use. Otherwise, for short term stuff, you can always use local storage as a convenience factor, but it maybe not be reliable (if they empty the browsers storage or use a new machine).

Hope this helps!

How to implement a refresh token for jwt token - web assembly by ryukin2 in Blazor

[–]MitchellNZ 1 point2 points  (0 children)

No worries, I understand. I had a lot of refactoring to do myself.

But it was worth it and I would highly recommend considering changing to this if you can find the time to refactor!

It is much easier to maintain once implemented, and since auth is so important, you don’t have to worry about making sure it’s done correctly, since this way will be widely used, tested and peer reviewed.

How to implement a refresh token for jwt token - web assembly by ryukin2 in Blazor

[–]MitchellNZ 1 point2 points  (0 children)

I was using the same implementation you have linked, and ended up writing my own custom client side OIDC wrapper to get working how I liked..

However, Blazor WASM 3.2.0-preview2 release has included an out of the box, easy to use auth system for token based auth!

Check out details here: https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-preview-2-release-now-available/

I have switched to this myself and it’s good! Couple of issues I am tracking on their GitHub, but it’s pretty polished!

“Go check out the Corpse Flower” they said... by MitchellNZ in chch

[–]MitchellNZ[S] 2 points3 points  (0 children)

Wow, was it as long as the picture when you waited? I didn’t end up queuing..

Rancid-smelling corpse flower opening up by RealmKnight in chch

[–]MitchellNZ 3 points4 points  (0 children)

Yes it is.. I just posted a picture of the line

Wiggle wiggle pounce by MitchellNZ in cats

[–]MitchellNZ[S] 1 point2 points  (0 children)

This is awesome! Didn't know it existed haha. Thanks for sharing!

Wiggle wiggle pounce by MitchellNZ in cats

[–]MitchellNZ[S] 0 points1 point  (0 children)

Unfortunately we don't have IKEA in New Zealand... yet. However, it came from a similar style shop!

Wiggle wiggle pounce by MitchellNZ in cats

[–]MitchellNZ[S] 5 points6 points  (0 children)

She's a Birman! We just got her yesterday.

Cheapest way to control blinds/curtains via zigbee by T_Tronix in homeassistant

[–]MitchellNZ 0 points1 point  (0 children)

If anyone is interested, for existing blinds I found this: https://www.somasmarthome.com/
Still a bit more than I'd want to spend per blind..

Empty paper towel roll by MitchellNZ in Perfectfit

[–]MitchellNZ[S] 0 points1 point  (0 children)

Haven't tried yet.. but I hope so! Will be the new storage place for them ;)

Empty paper towel roll by MitchellNZ in Perfectfit

[–]MitchellNZ[S] 0 points1 point  (0 children)

He is! And he's still just a kitten (5 months old), so will hopefully get softer!

Empty paper towel roll by MitchellNZ in Perfectfit

[–]MitchellNZ[S] 2 points3 points  (0 children)

Hopefully! Because this will be my new paper towel storage space!

Empty paper towel roll by MitchellNZ in Perfectfit

[–]MitchellNZ[S] 22 points23 points  (0 children)

Hahaha, his name is Neko.. which is actually Japense for "cat".. original, I know ;)

Empty paper towel roll by MitchellNZ in Perfectfit

[–]MitchellNZ[S] 15 points16 points  (0 children)

He's a blue point (or grey, as some say) Ragdoll :)

Empty paper towel roll by MitchellNZ in Perfectfit

[–]MitchellNZ[S] 16 points17 points  (0 children)

Honestly, wasn’t expecting this much attention, so didn't overthink it 😅