Open atherdon opened 5 years ago
@vadim9999 can you, by using code example that you've made here https://github.com/GroceriStar/calendar/pull/69/commits/d1bd32f03204da58aada4d74fa7ce04d7274db92 - create a great explanation about what we should do for our team members?
In src need create folder selectors with Selector.js. There you should add imports that used in current project and create methods to get data. For example, fetch conected in component like this
//ColumnRender.js
import data from "@groceristar/groceristar-fetch/mealCalendar";
var result = mealCalendar.getDishByWeek("week1");
In latest version of fetch need to rebase import from
import data from "@groceristar/groceristar-fetch/mealCalendar";
to
import { mealCalendar } from "@groceristar/groceristar-fetch";
//Selector.js
import { mealCalendar } from "@groceristar/groceristar-fetch";
function getDish(week){
return mealCalendar.getDishByWeek(week);
}
Now in ColumnRender
//ColumnRender.js
import { getDish } from "../selectors/Selector.js";
var result = getDish("week1");
Based on Vadim comment
1) Recipe App https://github.com/ChickenKyiv/recipe-app-react-native/blob/master/src/components/Directions/index.js#L7 https://github.com/ChickenKyiv/recipe-app-react-native/blob/master/src/components/FreeRecipes/index.js#L6 https://github.com/ChickenKyiv/recipe-app-react-native/blob/master/src/components/GroceryList/GroceryList.js#L8 https://github.com/ChickenKyiv/recipe-app-react-native/blob/master/src/components/GroceryList/index.js#L12 https://github.com/ChickenKyiv/recipe-app-react-native/blob/master/src/components/GroceryListSettings/index.js#L12
https://github.com/GroceriStar/react-native-shoppin-list/blob/components-structure/src/components/layouts/GroceryList.js#L5 https://github.com/GroceriStar/react-native-shoppin-list/blob/components-structure/src/components/layouts/IngredientDetails.js#L7 https://github.com/GroceriStar/react-native-shoppin-list/blob/components-structure/src/components/layouts/Todo.js#L5
https://github.com/GroceriStar/react-native-shoppin-list/blob/components-structure/src/HelperFunctions.js
https://github.com/GroceriStar/showcase https://github.com/GroceriStar/calendar https://github.com/ChickenKyiv/recipe-search-react https://github.com/GroceriStar/react-only-intern-23
https://github.com/GroceriStar/react-shopping-list-template
https://github.com/ChickenKyiv/recipe-box