Ben Durrant

Results 146 comments of Ben Durrant

wondering about an overloaded function, e.g. ```ts v.mapEntries(Schema, v.optional) // make all optional v.mapEntries(Schema, { name: v.nullable, age: v.optional, email: (schema) => v.nullish(schema, 'default_value'), }) // manually specify each //...

right, but the point is that we can't properly infer from a user submitted "one fits all" mapper what each entry should look like. For example: ```ts const userSchema =...

with Zod the coercion isn't separate from the schema (it just happens as the first step of the schema if configured), so `z.coerce.number()` would be the same as `v.pipe(v.unknown(), v.toNumber(),...

sure, so just the `v.wrapEntries(userSchema, v.exactOptional)` API?

changes look good, thank you 😄

> Hey 👋 thank you! Is this PR in a final stage? yep, should be

it's an idea we've briefly touched on a couple times before (and made a draft PR here https://github.com/reduxjs/redux-toolkit/pull/4128) but it never solidified. if we want it i suspect that PR...

note that initiate actually wraps the promise, so instead of getting the action you get an object that either looks like { data } or { error }

@Thorin537 instead of saving the *data* again, save the arg. ```ts const dispatch = useDispatch() const arg = useSelector(selectMyArg) const { data } = useMyQuery(arg) function changeArg(newArg) { dispatch(argChanged(newArg)) }...

@Thorin537 select() returns a memoized selector instance, which should then be called with the root state. ```ts const selectFooPost = myApi.endpoints.getPosts.select('foo') const fooPostCache = selectFooPost(store.getState()) ```