Comments (6)
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.
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.
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.
Returning a promise shouldn't break anyone, I think?
from plugapi.
Changing to promises requires a large discussion on the direction of plugapi
from plugapi.
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)
- Errors in callback functions passed to playlist methods are mishandled HOT 2
- Should treat URLs as atoms when splitting long chat messages HOT 5
- Use ES6 Promise in place of callbacks HOT 5
- The advance event when last DJ finishes has djs.length == 2 HOT 2
- Chat events mentions are always [] HOT 3
- Duplicate advance event on skip (some times) HOT 2
- Playlist management functions some times silently fail HOT 5
- Cannot read property 'length' of undefined HOT 3
- Bot gets 403 error, restarts at random intervals HOT 7
- addToWaitList throws 403 error when target user has no playlists HOT 3
- Errors trying to perform npm install plugapi HOT 2
- Error after connection with account without playlist HOT 2
- Not sure if playlist functions are working properly
- Unsupported events
- User.language is null HOT 2
- Room Description HOT 8
- Convert name to ID? HOT 8
- Have a bot.
- I'm using your api for a plug bot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugapi.