Git Product home page Git Product logo

aragon.js's Introduction

aragon.js Basic Overview

The layer between Aragon Core and the Aragon web- and desktop application. Use it to build third-party apps for Aragon, or to roll your own front-end.

Install

npm i @aragon/client

Quick Start

const Aragon = require('@aragon/client')

// Set up app
const app = new Aragon()

// Set app identifier
// Just an example, should be more descriptive (e.g. for our token manager, we use the ticker of the token it manages)
app.identify(Math.random())

// Listen to events and build app state
const state$ = app.store((state, event) => {
  // Initial state
  if (state === null) state = 0

  // Build state
  if (event.event === 'Decrement') {
    state--

    // Send notification
    app.notify('Counter decremented', `The counter was decremented to ${state}`)
  }
  if (event.event === 'Increment') {
    state++
    app.notify('Counter incremented', `The counter was incremented to ${state}`)
  }

  return state
})

// Log out the state
state$.subscribe(console.log)

// Send an intent to the wrapper
app.increment().subscribe(
  (txHash) => console.log(`Success! Incremented in tx ${txHash}`),
  (err) => console.log(`Could not increment: ${err}`)
)

Documentation

For wrappers, see here.

For apps, see here.

Contributing

Please take a look at our contributing guidelines if you're interested in helping!

aragon.js's People

Contributors

onbjerg avatar sohkai avatar izqui avatar bpierre avatar smokyish avatar luisivan avatar bingen 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.