Git Product home page Git Product logo

strategy_pattern_sample's Introduction

Run the project

Download the project, run

npm install

When installation is done, run

react-native run-ios

or

react-native run-android

Files of the project

Config folder

/config/all-components.js

It holds the list of the components we have with a key in a json object. If you want a component to have flexibility and be associated with a config file you should add it to this file.

/config/index.js

It holds all the config for the project and the components. Project logo, splashscreen, colours and details of the components can be set here. We can decide if we want to render a component or not or what should be the header title of the component and many more.

Helpers folder

/helpers/index.js

This file is in charge of rendering components inside other components as well as React Native Navigation. renderForNavigation return back the Component for navigation purpose. So in this project, our navigation is also decided by the config file and which component should be loaded when we are navigating to a specific screen. renderWithProps is used when we want to embed a component in another component and also decide if we want to show that embedded component or not. In addition to that, this function also receives the props from the parent component and pass them to the child component as it renders.

helpers/strategy.js

It is very similar to what we had in helpers.index file but we use this mostly to render part of a component. So depends on the project, we decide if that part should be scanned or not. For instance if component in one project has a button, we decide if the button should be rendered or now. It also gets the details from the config file.

strategy_pattern_sample's People

Contributors

aminpbsc avatar amin-wan-kenobi avatar

Forkers

sizmamani

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.