Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6213

calling a function from a const value

$
0
0

I have an initial state const item that looks like this:

const INITIAL_STATE = {  endPoint: { street: '', coordinates: [] }, //[13.3969, 52.5182]  startingPoint: { street: '', coordinates: [] }, //[13.413215, 52.521918]  favouritePoint: { street: '', coordinates: [] },  favouriteLocations: {getFavouritePlaces()},  // favouriteLocations: [  //   {  //     name: 'Zu Hause',  //     street: 'Müllersweg',  //     coordinates: [8.217462, 53.13975], //[8.258844, 53.119525],  //   },  //   {  //     name: 'Büro',  //     street: 'Philipp-Reis-Gang',  //     coordinates: [8.258844, 53.119525], //[8.217462, 53.13975],  //   },  //   {  //     name: 'KaffeeHaus',  //     street: 'Cloppenburgerstr.',  //     coordinates: [8.211, 53.113],  //   },  // ],  addressesFoundList: [],};

Instead of the hardcoded value, I am trying to call a function for favouriteLocations that will return an object of the same type. However, currently this does not call my function.

My function looks like this:

const getFavouritePlaces = () => {return ...}

Later on, I will be using this initial state for my redux setup.


Viewing all articles
Browse latest Browse all 6213

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>