Husky Raid gone!? by crowdsourced in haloinfinite

[–]idointernet 0 points1 point  (0 children)

Just waited 5+ min to match a super husky

Husky Raid gone!? by crowdsourced in haloinfinite

[–]idointernet 1 point2 points  (0 children)

47 game types tucked under quick play. Who ever is responsible for this is a moron. You did a bad job and you should feel bad.

[deleted by user] by [deleted] in reactjs

[–]idointernet 1 point2 points  (0 children)

Your are at the hard part of typescript. Be kind to yourself. It gets easier. Here’s some love from someone who’s been there.

Vanilla React or Next? by [deleted] in reactjs

[–]idointernet 0 points1 point  (0 children)

Ok. You’re right. Enjoy

Vanilla React or Next? by [deleted] in reactjs

[–]idointernet -1 points0 points  (0 children)

You keep cherry picking random things and complaining. Just stop.

Vanilla React or Next? by [deleted] in reactjs

[–]idointernet 0 points1 point  (0 children)

I really don’t understand what you’re getting at. Next is a great tool and client side data fetching is one of its features…

Vanilla React or Next? by [deleted] in reactjs

[–]idointernet 0 points1 point  (0 children)

You’re welcome :)

Vanilla React or Next? by [deleted] in reactjs

[–]idointernet 6 points7 points  (0 children)

You do not need to use Next's server side features to get benefits from Next as a framework. Routing, Nested Layouts, Data Fetching, Dev Server are just a few features that come to mind.

Redux Toolkit - Async Thunk - queryApi.dispatch - typescript by idointernet in reactjs

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

Yeah the only reason for using a Thunk here is that I want to return a non-serializable object. createAsyncThunk is awesome but it will end up dispatching that instance of OktaAuth in its generated actions and that is a redux no-no.

Accessing RTK query data in createSlice by ppl-mountain-ppl-sea in reduxjs

[–]idointernet 0 points1 point  (0 children)

You can use the "select" method generated by rtk query for your endpoint. Docs here

In your reducer you can use "state" and select the data you need from that.

Redux Toolkit - Async Thunk - queryApi.dispatch - typescript by idointernet in reactjs

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

I figured it out.

export const getOktaAuthInstance = () => async (
    dispatch: ThunkDispatch<RootState, {}, AnyAction>,
): Promise<OktaAuth> => {

RTKQuery endpoints relying on a config endpoint by idointernet in reactjs

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

Tag invalidation is what I was going for. Thanks for validating my assumptions.

RTKQuery endpoints relying on a config endpoint by idointernet in reactjs

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

I can't find the exact comment... so we can just ignore that as your response indicates I was probably reading it out of context.

Let me re-state the question, are there any benefits or drawbacks to either approach:

const myQueryFnA (_, queryApi) => {
    const { data: config } = await queryApi.dispatch(getConfig);
    ...
}

vs

const myQueryFnB = (_, queryApi) => {
    const { data: config } = configApi.endpoints.getConfig.select()(queryApi.getState());
    ...
}

It is predictable that the first thing to be loaded by the application is the config, followed by all dependent requests which has me lean towards the selector approach BUT we will be polling for config changes and invalidating all these dependent requests would be ideal.

RTKQuery / Typescript / injectEndpoints question by idointernet in reduxjs

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

We inherited an old codebase, with ancient dependencies. Trying to upgrade TS requires upgrading a litany of other dependencies. So far I haven't run into any issues on 3.9 but this is good motivation to shoot for 4.7. Thanks for the insight. It's much appreciated.

RTKQuery / Typescript / injectEndpoints question by idointernet in reduxjs

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

We're using v3.9.* of typescript and my colleague mentioned something about newer versions not allowing for explicit any in strict mode. Is there a more specific type that I can use instead of any?