Skip to content

vimaloneuser/swapi_dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to installation

$ npm i swapi.dev

Usage

import swapi from 'swapi.dev';

Live code example

import swapi from 'swapi.dev';

const App = () => {

  useEffect(() => {
    // root
    swapi.root().then(res => {
      console.log(res, "topic title list")
    })

    // dynamic topic listing
    swapi.topicListing({ topic: "people", page: 1 }).then(res => {
      console.log(res, "topic list")
    })
    // dynamic topic listing
    swapi.topicDeatail({ topic: "planets", id: 1 }).then(res => {
      console.log(res, "topic sub list")
    })

  }, [])

  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  return (
    <SafeAreaView style={backgroundStyle}>
      <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />

      <Text>Hello world...</Text>
    </SafeAreaView>
  );
};

export default App;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published