question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a plugin-like hooks for Marble.js applications

See original GitHub issue

Problem statement: Consider an example to build utility to print all the API effects/routes at the time of starting a server. This problem cannot be solved by middlewares. Also, Marble.js provides no hooks/events to let application developer know about the state of the server.

Solution Similar to how we have ErrorEffect, provide one more type of effect for common events. These server effects would be streams like other effects. They will be used by an application developer to handle the required scenarios.

Current alternative Since there is no abstraction on top of createServer, it leaves the code organization to the application developer. The developer will manually add callbacks or listen for various server events.

Notes: If we consider Marble.js as a framework, then it makes sense to provide developers with these hooks as framework essentially implies Inversion of Control (IOC). If the scope of Marble.js is more confined an express-like or a library-like feature-set, then it probably doesn’t make sense.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JozefFlakuscommented, Nov 19, 2018

Right now Marble.js is trying to reside between library and framework, but if we want to extend the tooling and available features in order to have more coherent place, we should definitely treat it more as a fully featured framework.

Yes, this kind of initialization process is something that we need introduce, but in version 2. Because we want to add a support for web sockets, this thing is required. Without an additional abstraction level, the Marble environment will be too diffused.

@krzysztof-miemiec BTW. @marblejs/cli is a cool idea 🤔

0reactions
devon-whilcommented, Mar 31, 2020

@mflorence99 Did you have any luck generating a swagger.yml in your marblejs apps? Any tips you could share here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Effects - Marble.js
Marble.js HttpEffect is a more specialized form of Effect for processing HTTP requests. Its responsibility is to map every incoming request to response...
Read more >
Hooks Guide - Apache Cordova
These hooks can be associated with all plugins within your application or be specific to only one plugin. Cordova supports the following hook...
Read more >
Using services | Docs | Fusion.js Engineering
React hooks are the preferred method for using services in React. In fact, many cases where we used class components can now be...
Read more >
Component testing scenarios - Angular
If you'd like to experiment with the application that this guide describes ... to import zone.js/plugins/zone-patch-rxjs-fake-async to patch RxJS scheduler.
Read more >
AUR (en) - Packages - Arch Linux
nextcloud-app-files-ebookreader, 0.0.1-1, 0, 0.00, Integrated Epub.js for Nextcloud ... A Nextcloud app that provides previews for camera RAW images, orphan.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found