@ipfn/session
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

IPFN Neuron firings Session in JavaScript

IPFN project Dependency Status Dev Dependency Status Circle CI

IPFN neurons runtime session in JavaScript.

Install

This project is available through npm. To install run:

> npm install @ipfn/session

Usage

import Session from '@ipfn/session';
import SynapticTypes from '@ipfn/synaptic-types';
import { neuron, synaptic } from '@ipfn/neurons';
import { fire, subscribe, lookup } from '@ipfn/runtime';

// const c = 'QmY3JV1FWbKLyr4SaRpbKpB1J1JEEyTTB3oZTTxAsF8gJC';

// Create a new session of firings
const session = new Session(keys);

// Lookup `Counter` neuron
const counter = lookup('QmY3JV1FWbKLyr4SaRpbKpB1J1JEEyTTB3oZTTxAsF8gJC/Counter');

// We will log to console all firings during this session
subscribe(session, counter.increment.count, count => {
  console.log(`Incremented to ${count}`);
});

// Fire `5` on `count` input on `increment` neuron
fire(session, counter.increment.count, 5);

See package tests for more examples.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.0
    1

Package Sidebar

Install

npm i @ipfn/session

Weekly Downloads

1

Version

0.0.0

License

none

Last publish

Collaborators

  • crackcomm