@ce1pers/use-resource

1.0.3 • Public • Published

@ce1pers/use-resource

React native hook to initialize resources.

Installation

npm

npm i @ce1pers/use-resource

yarn

yarn add @ce1pers/use-resource

Usage

// Import hook.
import { loadFonts,loadImages } from "@ce1pers/use-resource";
import { Ionicons } from "@expo/vector-icons";

export default function App() {

  ...

  const loadResources = async () => {
    // Add you want icons as arguments.
    const fonts = loadFonts([Ionicons.font]);
    await Promise.all([...fonts]);
  };

  ...

  return (
      <View>
        <Ionicons name="beer" size={20} />
      </View>
  );
}

Package Sidebar

Install

npm i @ce1pers/use-resource

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

1.99 kB

Total Files

4

Last publish

Collaborators

  • __coma__