GithubHelp home page GithubHelp logo

trifac / typescripttemplatetestapp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 297 KB

This app is develop for Redux and Type Script learning. Also create a template for further development.

JavaScript 3.15% Ruby 4.45% TypeScript 7.94% Starlark 1.62% Java 42.55% CMake 0.78% C++ 19.71% Shell 1.30% Objective-C 6.51% Objective-C++ 12.01%

typescripttemplatetestapp's Introduction

TypeScriptTemplateTestApp

This app is develop for Redux and Type Script learning. Also create a template for further development. The project structure is based on the Rehabilitation app.

Useful Link for Learning

  1. A tutorial of todo using typescript(good to start): https://ts.chibicode.com/todo/
  2. TypeScript for Beginner Programmers(Not check yet): https://github.com/chibicode/TypeScript-for-Beginner-Programmers
  3. Redux official guide (Boring): https://redux.js.org/tutorials/fundamentals/part-1-overview
  4. TypeScript online exercise (Beginner): https://typescript-exercises.github.io/
  5. Know more about the react-natvie: https://www.reactnative.guide/3-react-native-internals/3.1-react-native-internals.html

Note from Learning

1. Tutorial of Todo Using TypeScript

  • define a type to make sure that out input and output from a function is correct.
  • use readonly(Readonly<'Object'>) to make sure that the object's properties are not modified.
    • Readonly<'Object'> make whole object is readonly which like the map function in the javascript.
    • Readonly<'Object'> is for object, if we want to make the list is readonly, please use "readonly Todos[]"
  • Literal types: You can use exact values when specifying a type. This is called literal types.
    • The value is fixed forever if th object is readonly.
      // Returns an array where "done" is all true
      function completeAll(
          todos: readonly Todo[]
      ): CompletedTodo[] {
          // ...
      }
  • The Above example is using a CompletedTodo (which is a literal type) to output a fix done value object list.
  • Intersection Types: deduplicate the properties in two types
    • Like the && boolean operators, this one is tyep operators to combine two types.
  • Union Types: use A|B to create union type. --> The type can work like a Enum type in Android.
    type Place = 'home' | 'work' | { custom: string }
    • Use ? after the variable like code below to make the varible optional. (The variable like the ? in the Kotlin, but Kotlin is for null value checking)
      place?: Place
    • Union type is good for condition handling. (在判斷的時候,所有的類型都應該覆蓋到,不然會報錯)

2. TypeScript Generics for People Who Gave Up on Understanding Generics

It may useful if you want to add sth into this README

typescripttemplatetestapp's People

Contributors

trifac avatar trifa20731 avatar adriantam38 avatar

Watchers

 avatar

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.