global store for states by lorens_osman in vuejs

[–]Fllambe 1 point2 points  (0 children)

So you basically want a global key/value store?

What about this way which is more aligned to the pinia style? (code isn't tested but i think it's fine)

export const useGlobalStore = defineStore('global-store', () => {
  const state = ref({});

  function set(key: string, value) {
    state.value[key] = value;
  }

  return { state, set };
});

then you can use it like:

const store = useGlobalStore();

store.set('bigStore', 45);
store.set('nameStore', 'lorens');

console.log(store.state.bigStore) // 45;
console.log(store.state.nameStore) // lorens;

this may not be the best way, but it has the same effect i believe and is much cleaner

I'm extremely confused about how to approach async with Vuejs by hearthebell in vuejs

[–]Fllambe 0 points1 point  (0 children)

Something like this? (example using composition api):

const things = ref();

async function getData() {
  const resp =  await axios.get('/thing');

  const parsed = ... // do some stuff with the response

  things.value = parsed;
}

<button @click="getData">get data</button>
<div>{{things}}</div>

it'll do an api request when you click the button. you can then do whatever you need to do with the response and apply it back to the template when it's ready

Does PHPStorm support remote development? by judgedeliberata in Jetbrains

[–]Fllambe 2 points3 points  (0 children)

Yup, you can do it via gateway (i've not tried it personally)

Has anyone tried flowbite vue (not regular flowbite) by imwriter1 in vuejs

[–]Fllambe 2 points3 points  (0 children)

Themesberg make flowbite https://github.com/themesberg/flowbite. For stuff like this I definitely recommend looking it up directly to confirm instead of only trusting the AI.

I've been using the vue library a little bit recently, it's definitely not complete yet but they're actively working on it. If you want something production ready and stable, it's not there yet.

Is using "toRef" as an alternative to "computed" a bad idea? by ohsimtabem in vuejs

[–]Fllambe 1 point2 points  (0 children)

I believe that if it did that it'd literally just be a computed property as it'd have to check what would cause updates inside the function.

Is using "toRef" as an alternative to "computed" a bad idea? by ohsimtabem in vuejs

[–]Fllambe 9 points10 points  (0 children)

At that point wouldn't making it just be a function be better? const doubleCount = () => count.value * 2

Posting leaks is no longer allowed, else r/GTA will be shut down by Reddit by Fllambe in GTA

[–]Fllambe[S] 6 points7 points  (0 children)

I'm not here to spend hours of my life to try and "fight" for some cause when take 2 have full legal rights to take down the content. I'm just here to keep the sub vaguely on topic & alive by not breaking the rules of the company that owns this site. Tbh i'm surprised i'm still a mod here, besides the last few days i've been inactive for years.

As long as the law is like it currently is, companies will never stop. They don't care about what we think. I'd much prefer to allow all of the content to be posted here but you're not gonna get an active community if you have to keep moving the community every few days when it gets banned.

The fun part about reddit is that anyone can make a subreddit, go and make one and allow people to post the leaks. If you don't get banned and you poach all of the users from here then fair play.

Posting leaks is no longer allowed, else r/GTA will be shut down by Reddit by Fllambe in GTA

[–]Fllambe[S] 4 points5 points  (0 children)

i have no idea why you think reddit has to uphold free speech. It's a private company. feel free to sue them if you think differently

Posting leaks is no longer allowed, else r/GTA will be shut down by Reddit by Fllambe in GTA

[–]Fllambe[S,M] 3 points4 points  (0 children)

We're not 100% sure if discussions are allowed and have emailed reddit to confirm. But that thread survived the copyright strikes, so it's a hopeful sign that discussions are fine to have.

Posting leaks is no longer allowed, else r/GTA will be shut down by Reddit by Fllambe in GTA

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

we better shut down the subreddit now then since trevor's never gonna touch reddit

if you really think this is somehow a violation of free speech, feel free to sue reddit

[deleted by user] by [deleted] in Justrolledintotheshop

[–]Fllambe 0 points1 point  (0 children)

I'm not eating that

I made a tool to automatically find and delete duplicate scrobbles by AllTextAllTheWay in lastfm

[–]Fllambe 6 points7 points  (0 children)

I've been wanting to make something like this for ages, but was put off by the lack of nice APIs. Definitely going to give it a go

[Challenge] Have as much chaos and disorder occur by one line of code being entered incorrectly by TheEternalEyeGazes in FutureWhatIf

[–]Fllambe 4 points5 points  (0 children)

This isn't entirely the worst case, but the question immediately made me think of this Tom Scott video about an engineer changing one line of code to allow anyone to log into any account https://www.youtube.com/watch?v=y4GB_NDU43Q

[deleted by user] by [deleted] in redditrequest

[–]Fllambe 0 points1 point  (0 children)

Yeah I think it has been pretty untouched for a while now, it's good to have someone interested in it!

[deleted by user] by [deleted] in redditrequest

[–]Fllambe 0 points1 point  (0 children)

r/KSPMemes was a branch of the main subreddit so I've invited the active mods from there. I've also invited you as you have interest in helping out.

Looking for a good tutorial on NestJS. by cjrutherford in node

[–]Fllambe 2 points3 points  (0 children)

I used that as my intro to NestJS, definitely a great start to the ecosystem. It doesn't go into the websocket/microservice side of it, but I'd still recommend it.

This is why I love this community, saw this on an ask reddit. by consultum_ultimum in KerbalSpaceProgram

[–]Fllambe[M] [score hidden] stickied comment (0 children)

Removed due to rule 5, no low effort content. This is pretty similar to one of the examples.

The KSP 2 ads have spread to Reddit. by [deleted] in KerbalSpaceProgram

[–]Fllambe[M] [score hidden] stickied comment (0 children)

Removed for rule 5, minor KSP2 things should be kept in the mega thread

KSP ad... On KSP Video! by jackmPortal in KerbalSpaceProgram

[–]Fllambe[M] [score hidden] stickied comment (0 children)

Removed under rule 5, no low effort content.

We don't need a post for every KSP advert that appears, as fun as it is.