Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create AxiosSearch.kt #23

Merged
merged 9 commits into from
Nov 28, 2017
Merged

Create AxiosSearch.kt #23

merged 9 commits into from
Nov 28, 2017

Commits on Nov 25, 2017

  1. Create AxiosSearch.kt

    /**
     * An example to show how to leverage axios lib to fetch remote data by [email protected] ([email protected])
     * (Btw, Vue.js formally leverage axios for ajax related works, so it should be good if React.js also use it)
     *
     * Date: Nov 25, 2017
     */
    ScottHuangZL authored Nov 25, 2017
    Configuration menu
    Copy the full SHA
    b530fab View commit details
    Browse the repository at this point in the history
  2. Change to common js way per Hypnosphi advice.

    Change from
    // You need input correct axios.min.js link address in public\static\index.html
    // I personally download axios.min.js proactive in put it into public\static\js folder
    // <script src="%PUBLIC_URL%/static/js/axios.min.js"></script>
    // or you can put   <script src="https://unpkg.com/axios/dist/axios.min.js"></script>     into index.html to avoid proactive download to local
    // And we provide a simple fun to wrap axios.js, it is not type safe, suggest JB team to provide a formal wrapping for this useful lib
    
    to
    @jsmodule("axios")
    ScottHuangZL authored Nov 25, 2017
    Configuration menu
    Copy the full SHA
    2668249 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2017

  1. Update AxiosSearch.kt

    Refactor onChangeFunction to 2 small fun.
    Add simple type for the axios.
    
    I am not familiar with how to add type for external javascript lib.  Please feel free to upgrade/enhance from my code directly. Thanks.
    ScottHuangZL authored Nov 26, 2017
    Configuration menu
    Copy the full SHA
    876a114 View commit details
    Browse the repository at this point in the history
  2. change js{} to jsObject{} for type safe

    change js{} to jsObject{} for type safe
    ScottHuangZL authored Nov 26, 2017
    Configuration menu
    Copy the full SHA
    6dd7c0a View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2017

  1. Add typing both for axios response and error

    Add typing both for axios response and error
    ScottHuangZL authored Nov 27, 2017
    Configuration menu
    Copy the full SHA
    e00be55 View commit details
    Browse the repository at this point in the history
  2. Continue enhance axios typing

    Add more typing for axios config/response/error
    Now, people should be able leverage typed axios lib to more easily  co-work with Kotlin-React to create a real app.
    ScottHuangZL authored Nov 27, 2017
    Configuration menu
    Copy the full SHA
    5464cc3 View commit details
    Browse the repository at this point in the history
  3. Add response data type

    Add response data type
    ScottHuangZL authored Nov 27, 2017
    Configuration menu
    Copy the full SHA
    7c5167e View commit details
    Browse the repository at this point in the history
  4. add errorMessage field

    add errorMessage field
    ScottHuangZL authored Nov 27, 2017
    Configuration menu
    Copy the full SHA
    51c634d View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2017

  1. Add generic type for axios

    It finally works for geeric type:)
    Thanks for @Hypnosphi professional advice, does learn something from him!
    ScottHuangZL authored Nov 28, 2017
    Configuration menu
    Copy the full SHA
    d25d3e8 View commit details
    Browse the repository at this point in the history