Skip to content

tetcoin/spycraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spycraft Suite

Build Status

npm:spycraft npm:spycraft-tetsy npm:spycraft-react

The spycraft suite consists of three independent packages:

Documentation

Documentation to all three packages can be found here

Examples

spycraft

// npm i spycraft
import {TimeSpook} from 'spycraft'


// Initialize the spook
const spook = new TimeSpook()
spook
    .map(t => new Date(t))
    .tie(date => console.log(`${date}`))
    // Wed Oct 11 2017 12:14:56 GMT+0200 (CEST)

spycraft-tetsy

// npm i spycraft-tetsy
import {Spooks, formatBalance} from 'spycraft-tetsy'

const spooks = Spooks()

spooks.balance(spooks.me)
    .map(formatBalance)
    .tie(console.log) // 4.45 ETH

spycraft-react

import ReactDOM from 'react-dom'
import React, { Component } from 'react'

// Import reactive element
import {Rspan} from 'spycraft-react'
import {Spooks, formatBalance} from 'spycraft-tetsy'

const spooks = new Spooks()

class App extends Component {
  render() {
    // Simply render spooks
    return (
      <div>
          <Rspan>
            {spooks.me} has 
            {spooks.balance(spooks.me).map(formatBalance)}
          </Rspan>
      </div>
    );
  }
}

ReactDOM.render(<App />, document.querySelector('body'))