Coder Social home page Coder Social logo

df-iframe's Introduction

Install project

Clone repo:

git clone https://github.com/AlyStoned/df-iframe.git

Install yarn:

npm install --global yarn
yarn --version

Install project deps (in the project directory):

yarn install

Start local server:

yarn start

Explanation

This is an example of using the exposed API of DF application (app.digifabster.com).

Exposed API - properties and functions of the DF application that you can use from another browser window.

We rely on the channel messaging from the browser API to expose our application's API. To simplify that process, we use comlink, this helps us build a neat way to communicate between windows. Comlink is the only peer dependency to use the exposed API since we use it inside the DF application. In this example we've also used @billjs/event-emitter to emit api ready event, but it's not necessary. Here is a possible implementation of the client part of the API, it's just a wrapper waiting for DF exposed API readiness signal.

Exposed API

The DF application is ready to listen for such calls:

transferModels, it takes a list of File objects as the first argument.

Usage example based on our implementation:

exposedApi.call(
    'transferModels',
    fileObjects.map(fileObject => fileObject.file),
);

Current API scheme

interface ExposedAPI {
    transferModels: (files: File[]) => void;
}

df-iframe's People

Contributors

alystoned 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.