Configure an initial state of the redux store in react-native-debugger?Where to write to localStorage in a Redux app?Redux - multiple stores, why not?How to reset the state of a Redux store?Accessing Store within Redux and React Native appReact Native setState in component updating redux storeReact-navigation Redux State managementShould I use redux-form store instead of component state and Redux custom store?Combining React local state with Redux global stateLoad redux store initial state in Detox Testinghow to pass a state to a container in react nativeReact Native & redux get current state in listener
Is this n-speak?
How to gracefully leave a company you helped start?
Are there any other rule mechanics that could grant Thieves' Cant?
Transition to "Starvation Mode" in Survival Situations
How can I communicate my issues with a potential date's pushy behavior?
How to remove ambiguity: "... lives in the city of H, the capital of the province of NS, WHERE the unemployment rate is ..."?
Would the USA be eligible to join the European Union?
(A room / an office) where an artist works
Why aren’t there water shutoff valves for each room?
Do beef farmed pastures net remove carbon emissions?
Word for an event that will likely never happen again
How to prevent criminal gangs from making/buying guns?
Human with super efficient metabolism
Should I leave building the database for the end?
Why aren't rainbows blurred-out into nothing after they are produced?
Boss wants me to ignore a software API license
If a person claims to know anything could it be disproven by saying 'prove that we are not in a simulation'?
Weird resistor with dots around it
Why command hierarchy, if the chain of command is standing next to each other?
How far did Gandalf and the Balrog drop from the bridge in Moria?
Why did IBM make the PC BIOS source code public?
Did DOS zero out the BSS area when it loaded a program?
Is it possible to arrive in the US without a C-1 visa for a transit flight
How did Arecibo detect methane lakes on Titan, and image Saturn's rings?
Configure an initial state of the redux store in react-native-debugger?
Where to write to localStorage in a Redux app?Redux - multiple stores, why not?How to reset the state of a Redux store?Accessing Store within Redux and React Native appReact Native setState in component updating redux storeReact-navigation Redux State managementShould I use redux-form store instead of component state and Redux custom store?Combining React local state with Redux global stateLoad redux store initial state in Detox Testinghow to pass a state to a container in react nativeReact Native & redux get current state in listener
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Is it possible to configure an initial state of the redux store in react-native-debugger?
I'm imagining pointing it towards a JSON file on my disk or something like that.
This would allow be to have arbitrary places in user journeys as my starting point, that require a complex state of the redux store to already be present.
react-native redux react-redux redux-store react-native-debugger
add a comment |
Is it possible to configure an initial state of the redux store in react-native-debugger?
I'm imagining pointing it towards a JSON file on my disk or something like that.
This would allow be to have arbitrary places in user journeys as my starting point, that require a complex state of the redux store to already be present.
react-native redux react-redux redux-store react-native-debugger
do you actually want some redux store to be present when you start/restart your app ? if so then you can hydrate the store when the app launches
– warl0ck
Mar 27 at 11:14
Yes, that's what I want! What does "hydrating the store" mean?
– moejoe
Mar 27 at 11:19
its just fancy way of saying restoring the old saved store, I have posted the exmaple on how you can retrieve the store and save it
– warl0ck
Mar 27 at 12:25
add a comment |
Is it possible to configure an initial state of the redux store in react-native-debugger?
I'm imagining pointing it towards a JSON file on my disk or something like that.
This would allow be to have arbitrary places in user journeys as my starting point, that require a complex state of the redux store to already be present.
react-native redux react-redux redux-store react-native-debugger
Is it possible to configure an initial state of the redux store in react-native-debugger?
I'm imagining pointing it towards a JSON file on my disk or something like that.
This would allow be to have arbitrary places in user journeys as my starting point, that require a complex state of the redux store to already be present.
react-native redux react-redux redux-store react-native-debugger
react-native redux react-redux redux-store react-native-debugger
asked Mar 27 at 10:58
moejoemoejoe
2,0272 gold badges9 silver badges16 bronze badges
2,0272 gold badges9 silver badges16 bronze badges
do you actually want some redux store to be present when you start/restart your app ? if so then you can hydrate the store when the app launches
– warl0ck
Mar 27 at 11:14
Yes, that's what I want! What does "hydrating the store" mean?
– moejoe
Mar 27 at 11:19
its just fancy way of saying restoring the old saved store, I have posted the exmaple on how you can retrieve the store and save it
– warl0ck
Mar 27 at 12:25
add a comment |
do you actually want some redux store to be present when you start/restart your app ? if so then you can hydrate the store when the app launches
– warl0ck
Mar 27 at 11:14
Yes, that's what I want! What does "hydrating the store" mean?
– moejoe
Mar 27 at 11:19
its just fancy way of saying restoring the old saved store, I have posted the exmaple on how you can retrieve the store and save it
– warl0ck
Mar 27 at 12:25
do you actually want some redux store to be present when you start/restart your app ? if so then you can hydrate the store when the app launches
– warl0ck
Mar 27 at 11:14
do you actually want some redux store to be present when you start/restart your app ? if so then you can hydrate the store when the app launches
– warl0ck
Mar 27 at 11:14
Yes, that's what I want! What does "hydrating the store" mean?
– moejoe
Mar 27 at 11:19
Yes, that's what I want! What does "hydrating the store" mean?
– moejoe
Mar 27 at 11:19
its just fancy way of saying restoring the old saved store, I have posted the exmaple on how you can retrieve the store and save it
– warl0ck
Mar 27 at 12:25
its just fancy way of saying restoring the old saved store, I have posted the exmaple on how you can retrieve the store and save it
– warl0ck
Mar 27 at 12:25
add a comment |
1 Answer
1
active
oldest
votes
Before creating the store just read the json file that you need with your inital state and call it that way:
// store.js
import data from "yourFile.json";
...
const mydata = JSON.parse(data);
const store = createStore(
app,
mydata
);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55375547%2fconfigure-an-initial-state-of-the-redux-store-in-react-native-debugger%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Before creating the store just read the json file that you need with your inital state and call it that way:
// store.js
import data from "yourFile.json";
...
const mydata = JSON.parse(data);
const store = createStore(
app,
mydata
);
add a comment |
Before creating the store just read the json file that you need with your inital state and call it that way:
// store.js
import data from "yourFile.json";
...
const mydata = JSON.parse(data);
const store = createStore(
app,
mydata
);
add a comment |
Before creating the store just read the json file that you need with your inital state and call it that way:
// store.js
import data from "yourFile.json";
...
const mydata = JSON.parse(data);
const store = createStore(
app,
mydata
);
Before creating the store just read the json file that you need with your inital state and call it that way:
// store.js
import data from "yourFile.json";
...
const mydata = JSON.parse(data);
const store = createStore(
app,
mydata
);
answered Mar 27 at 11:33
Carlos RuanaCarlos Ruana
1,22811 silver badges11 bronze badges
1,22811 silver badges11 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55375547%2fconfigure-an-initial-state-of-the-redux-store-in-react-native-debugger%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
do you actually want some redux store to be present when you start/restart your app ? if so then you can hydrate the store when the app launches
– warl0ck
Mar 27 at 11:14
Yes, that's what I want! What does "hydrating the store" mean?
– moejoe
Mar 27 at 11:19
its just fancy way of saying restoring the old saved store, I have posted the exmaple on how you can retrieve the store and save it
– warl0ck
Mar 27 at 12:25