npm

Need private packages and team management tools?Check out npm Orgs. »

@ipfn/session

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.

Keywords

none

install

npm i @ipfn/session

Downloadsweekly downloads

1

version

0.0.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability