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.

Great work! And some comments/tips

See original GitHub issue

I really like how almost identical it is to redux, and how it enables me early access to some of the things that might trickle down into react-redux. I don’t like however that initial state is required.

I use typesafe-actions for mostly everything. And I use initial state in my reducers and have never depended on providing initial state on the top level where I combine the reducers. I mean, how silly is that? Therefore I have to do the following to be compliant with this library, and its really not a big deal:

const initialState = reducers(undefined, { type: undefined });

export const { GlobalStateProvider, dispatch, useGlobalState } = createStore(
    reducers,
    initialState,
    enhancers
);

Isn’t there a possibility that this library could do this automatically when it doesn’t receive initial state?

otherwise, I am going to do some tests now where I confirm the fact that needs to just work: sibling components that uses useGlobalState should not be affected by unrelated updates to the global state. I am sure that it works, but I haven’t got the time to make this test yet. By opening react devtools and highlighting updates, this is very easy to check, but I need to just hack up some components.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:31 (31 by maintainers)

github_iconTop GitHub Comments

1reaction
jarlahcommented, Mar 17, 2019

@dai-shi i will update the wiki if i am allowed to 😃 (i am. Great 😉)

1reaction
jarlahcommented, Mar 16, 2019

Ooh … and i have confirmed btw that the library does what its supposed to 😃 made two sibling components with different substate subscriptions. and they do logically not cause the other component to update when dispatching an action that should only affect the one. just needed to test it, since its a basic assumption/requirement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Comments - Tips to receive 10x more feedback - The Skip - Substack
This is very relatable and a great article. Yes, Probing specific questions has helped me get more detailed feedback. You mentioned development feedback...
Read more >
40+ Best Performance Appraisal Comments: Tips and Samples
Let's dive into some outstanding examples of appraisal comments. ... One of the essential forms of appraisals at work is self-appraisal.
Read more >
How to Write Constructive Peer Review Comments
Like the art of tightrope walking, writing helpful peer review comments requires honing the ability to traverse many fine lines.
Read more >
Stream Edstase - preview (work in progress) * comments / tips pls ...
Stream Edstase - preview (work in progress) * comments / tips pls! * by edstase on desktop and mobile. Play over 265 million...
Read more >
Tips & Hacks Archives - Eduvate
Eduvate 0 Comments Tips & Hacks. Your first day in the job. It's a big day. First impressions matter and will set perceptions...
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