DEV Community

Emilie Ma
Emilie Ma

Posted on • Edited on

Halfway through GFTW!

Well, it's technically a bit over half, but moving swiftly onwards...

What I've been working on

I've been working on a revenue sharing library, written in vanilla Javascript.

It'll include a <rev-share> element that utilizes the probabilistic revshare model outlined on the webmonetization.org site.

It can be found on GitHub and on NPM.:

GitHub logo kewbish / revshare

A JS library created for #gftwhackathon.

Revshare.js 💸

A JS library for revenue sharing, made for the #gftwhackathon.
Available on NPM at @kewbish/revshare.
Made in JS, May 2020.
Created by Kewbish.
Released under the MIT License.

Installation Usage

This package is available on NPM at @kewbish/revshare.

  • Run npm i @kewbish/revshare to install it in your project.
  • It can then be referenced as below:
<script src="./node_modules/@kewbish/revshare/dist/index.min.js"></script&gt

Alternatively, add a <script> tag in your <head>:

<script src="https://unpkg.com/@kewbish/revshare"></script&gt

Basic Usage

Add a <rev-share> tag anywhere in your body.
This tag requires a pointers attribute, formatted in JSON.

...
<rev-share pointers='{"$john.wallet": 50, "$alicia.wallet": 50}'>
    <p>This is your revenue-shared content!</p>
</rev-share>
...

Additional documentation can be found in the docs folder.

⚠️ This rev-share specification is not 100% accurate, due to the probablistic nature and the limitations of the Web Monetization format.

Project Information

This project is based on the proposed Web Monetization interface. It's…

Both are still undergoing development - as I like to say, don't scronch please.

I'm pretty well through the project: only some bugfixes and implementing some other minor features.

Right now, it has a pointers attribute RNG feature, and an additional exclusive revshare feature. I'm pretty happy with it - it's small, but it's mine!

I would consider myself better versed in Python than Javascript, and this was a great learning opportunity to get into Web Components. I can now see parts of what powers frameworks like Vue. As well, I familiarized myself with some more common Javascript functions, like arrow and forEach functions.

One great resource I used during this time was the Mozilla Web Components docs. For some reason, the Google page was a little out-of-date regarding defining an element, and Mozilla's docs really helped me understand the lifecycle events and some best practises.

Journey

I started out by researching and looking around for ideas. I was initially going to build a component library with Vue, but realized that my experience with Javascript was too limited even to build a proper component.

I then moved to thinking about vanilla Javascript, and that's what I decided on pursuing for the hackathon. Then, I started skimming docs, and started building for real! That's mostly what I've been doing for the last weeks (though I had a computer problem that delayed me for weekend.)

I look forward to finishing up, and submitting the project! This hackathon was super fun to work with, and reading everyone's posts about their projects was also very inspiring.

This was also my first post on Dev! My blog is undergoing some construction right now, so I'll try to post / crosspost more frequently here in the meantime.

Top comments (0)