question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

data state dose not want to be deep wrapped model

See original GitHub issue

just want user is a data state not a modal

interface User {
   name: string;
   getDisplayName:  () => string
}

interface UserModal {
  user: User;
  fetchUser: thunk(.....)
}

const user = useStoreState(state => state.userModal.user)

the user is StateMapper<User> ??? just want the user is User not StateMapper<User>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ctrlplusbcommented, Mar 31, 2020

Hi @yongningfu

The latest 3.4.0 alpha release fixes this issue.

Let me know if it works for you. See #459 for more info. 👍

1reaction
yongningfucommented, Jan 17, 2020

Hi @yongningfu

So to be clear you don’t like that it is reporting state.user to be of type _Merge<StateMapper<_Pick<_Pick<User, "id" | "name" | "displayName" | "has" | "get" | "hasIn" | "getIn" | "equals" | "hashCode" | "set" | "update" | "merge" | "mergeDeep" | "mergeWith" | "mergeDeepWith" | ... 16 more ... | "toSeq">, "displayName" | ... 28 more ... | "toSeq">, "2">, _Pick<...>>?

Do the immutable API’s still work even though the type is definition has changed to this?

@ctrlplusb yes That’s what I’m confused about,because i write some util function , them accept the type is User not _Merge<StateMapper<_Pick<_Pick<User,

just like

import { User } from "../model/user";

const store = createStore(model, {});

const user = store.getState().user.user;

function checkUser(user: User) {}

checkUser(user); // type error

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using v-model on Nested Vue Components - Zaengle Corp
A computed setter allows us to nest v-model calls and automatically keeps the data synced between parent and child components. Pretty cool!
Read more >
Wrap-up | Machine Learning
This document provides an introduction to machine learning for applied researchers. While conceptual in nature, demonstrations are provided for several ...
Read more >
Models, Preprocessors, and Action Distributions — Ray 2.2.0
The following diagram provides a conceptual overview of data flow between different components in RLlib. We start with an Environment , which -...
Read more >
How To Share State Across React Components with Context
In this tutorial, you'll share state across multiple components using React context. React context is an interface for sharing information ...
Read more >
Train 1 trillion+ parameter models - PyTorch Lightning
During the first training step, the warmup phase will sample the maximum non-model data memory (memory usage expect parameters, gradients, and optimizer states) ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found