@7rabbit/ink-runtime

Ink basic JavaScript actions

Usage no npm install needed!

<script type="module">
  import 7rabbitInkRuntime from 'https://cdn.skypack.dev/@7rabbit/ink-runtime';
</script>

README















ink-runtime

Ink basic JavaScript actions



IntroductionInstallationIllustration




Introduction

The Ink runtime is all the basic JavaScript functions to build upon.

Installation

npm install @7rabbit/ink
npm install @7rabbit/ink-runtime

Illustration

This is a Hello World example.

import runtime from '@7rabbit/ink-runtime'
import Ink from '@7rabbit/ink'

let ink = new Ink()
ink.attachModule(runtime)

The rest of what follows is an API reference documenting every method ink-runtime attaches to the ink object.

commitAspect(source, aspect, object)

Set the field, property, or attribute aspect on source to object.

detachAspect(source, aspect)

Detach the field, property, or attribute aspect on source.

invokeMethod(source, method, ...args)

Call the method on source with args.

wait(delay, action)

Delay invoking action for delay milliseconds.

throttle(threshhold, action)

Invoke the action once every threshold milliseconds, even if it is called multiple times within threshold milliseconds.

addListener(source, type, action)

Invoke the action when event type is heard from source.

requestAnimationFrame(action)

Wait for the next animation step to run action provided by the environment.

import([path|function])

Import the module found at path, or provide a function to resolve the path relative to the current file.