Giter VIP home page Giter VIP logo

Comments (6)

thedark1337 avatar thedark1337 commented on August 12, 2024

yes, because its stored in a buffer object that doesn't result in an error. Its not the only function that isnt in the (err, data) => {} format.

getHistory
getActivePlaylist
getPlaylist
getPlaylists
getJar
(Maybe a few others)

These all don't use API methods to send a REST request and are documented to have the standard function callback style. All of them are cached in their respective locations in plugAPI itself.

from plugapi.

mortenn avatar mortenn commented on August 12, 2024

I kind of like it when APIs are consistent, would you be opposed to change them?
As a better alternative, if they returned a Promise, I wouldn't need to wrap them at all :)

from plugapi.

thedark1337 avatar thedark1337 commented on August 12, 2024

Changing them would break any user's code that uses callbacks unfortunately. I can't just change it to return callback(null, data);

from plugapi.

mortenn avatar mortenn commented on August 12, 2024

Returning a promise shouldn't break anyone, I think?

from plugapi.

samhmills avatar samhmills commented on August 12, 2024

Changing to promises requires a large discussion on the direction of plugapi

from plugapi.

thedark1337 avatar thedark1337 commented on August 12, 2024

Regarding the discussion on promise usage, that will be moved to #144.
As for this issue, RESTCallback as its named is in the form of error, data for API REST calls.

For those that are just pure setters / getters with no interaction with the REST API, those only return callback(data) or data.

from plugapi.

Related Issues (20)

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.