Code Monkey home page Code Monkey logo

seneca-promisified's Introduction

Seneca Promisified

This is a wrapper which makes senecajs not hostile to promises. Also permits you to access seneca context without having to use the this keyword (arrow functions).

This is not an extension, its just a wrapper; you will be able to use old seneca plugins without having to worry about what its going to break.

Promises

This libary uses any-promise. You will need to register the kind of promise you want the it to use.

See: https://www.npmjs.com/package/any-promise

API Documentation

See: http://aghost-7.github.io/seneca-promisified

seneca-promisified's People

Contributors

aghost-7 avatar cexmcote avatar nickapopolis avatar

Stargazers

码日光 avatar  avatar Marcus R. Brown avatar Rong Shen avatar Kristijan Sedlak avatar Edwin Allen avatar

Watchers

James Cloos avatar  avatar

Forkers

rjrodger

seneca-promisified's Issues

Performance: Use proxies

There are certain sections where I think we could improve the performance by rewriting the wrapper to use proxies. Example scenario where the performance would be significantly improved:

var ent = await seneca.make('user').load$(1);
ent.active = true;
await ent.save$();

Right now, it does a full sync of the properties during the save$ call. With proxies this would be reduced to a single property on the legacy entity of being set.

Would need some a/b performance tests.

Wrapped entity data$ method always returns undefined

Hi, and thanks for wrapping!

I think I've found a glitch:

const seneca = new SenecaPromisified(this);
const ent = seneca.make('example');
ent.data$({foo: 'bar'}); // this works
console.log( ent.$data(false) || ent.data$() ); // but this returns undefined

I think this function should return.

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.