I have a file called data that initializes a class using a list. I'm wondering if it is possible to add data to this file automatically from another file by importing the data.js file. Is that possible ? If so how would i go about it. Because I tried using .push() and .concat() from my app.js file but I don't see it update in the data.js file.
The Data.js file
export const CATEGORIES = [
new Catergory('My Recipies', 'My Recipies',myRecipies),
new Catergory('Italian', 'Italian', italian),
new Catergory('Indian', 'Indian',indian),
new Catergory('Western', 'Western',western),
new Catergory('Quick n Easy', 'Quick n Easy',quick),
new Catergory('Desert', 'Desert',desert),
new Catergory('Breakfast', 'Breakfast',breakfast),
]
App.js File
import data from './Data/categories/data'
import Catergory from './Data/categories/Catergory'
data.push(
new Catergory('Drinks',' My Recipies', myRecipies)
)
I would really appreciate it from the bottom of my heart if someone could help me add this app.js code to my external data.js. Thank you in advance!!!!!