@dynamix/fs

0.0.0 • Public • Published

Dynamix by Grida

@dynamix/fs

@dynamix/fs

Dynamix filesystem utilities. This package is a utility package for handling file transfer between the host and the webview.

This package is compatible with

  • [x] React Native
  • [x] React
  • [x] Vue
  • [x] Other JS frameworks

Installation

yarn add @dynamix/fs

Usage

Below example is using React for host and React Native for webview.

// WEB NextJS
// mypage/page.tsx
import { useDynamix } from "@dynamix/react";

function WebMyPage(){
  const [photo, setPhoto] = useState(null);

  const onPhotoSelectClick = usePhotoPicker({
    readAs: "DataURL",
    multiple: false,
    onLoad: setPhoto
  });

  return (
    <Avatar onClick={onPhotoSelectClick} src={photo}/>
  )
}

// WEBVIEW on React Native
// pages/mypage.tsx
import { WebView } from "@dymamix/react-native";
import fs from "@dynamix/fs";

function AppMyPage() {
  return (
    <Webview>
      <DynamixFSProvider fs={fs}/>
    </WebView>
  )
}

Package Sidebar

Install

npm i @dynamix/fs

Weekly Downloads

1

Version

0.0.0

License

none

Unpacked Size

2.81 kB

Total Files

3

Last publish

Collaborators

  • softmarshmallow