fermata icon indicating copy to clipboard operation
fermata copied to clipboard

Composable plugins

Open natevw opened this issue 11 years ago • 3 comments

Couple things have felt awkward to me, especially in more casual use of Fermata:

  • for one-off requests, it's a little bummer that e.g. fermata.json("http://localhost:5984/db/_changes", {limit:5}) doesn't work. Perhaps it is good that URL initialization is different from normal URL extension, but it feels inconsistent.
  • related, it seems like something like connect's "use" chaining might be cooler than having this weird "low-level" (e.g. autoConvert/statusCheck) vs. "high-level" (e.g. json/raw/twitter/couchdb) plugin distinction.

natevw avatar Jan 31 '13 19:01 natevw

Another use case: a "timeout" mixin.

natevw avatar Nov 06 '13 21:11 natevw

I'd be happy to look into JSONP support for a plugin :)

therebelrobot avatar Feb 10 '14 18:02 therebelrobot

To expand on the OP, I still think that part of the issue here is we really have two types of plugins:

  • mixins that add a specific bit of behavior (e.g. statusCheck, autoConvert, oauth, a timeout provider, redirect follower…)
  • wrappers — for lack of better term, as Fermata never really "wraps" — that combine a certain set of mixins and add perhaps a bit of sugar to polish up dealing with a particular API (Twitter, Flickr, CouchDB, Chargify

One typical distinction being that the latter modify the transport they are given, while the former tend to just use it as-is.

natevw avatar Sep 22 '16 00:09 natevw