Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Substack pattern #73

Merged
merged 7 commits into from
Jul 21, 2015
Merged

Conversation

kosmotaur
Copy link
Contributor

Hi,

While trying to introduce new functionalities, we've found it more difficult than it could be to reuse logic. The code was relying on side effects, functions were sharing variables through JS scope and modules were fulfilling more than one responsibility, which has proven to be a significant hindrance.

This came about when we were working on a discoverability page, where we wanted to list all the API endpoints. We needed to share the ROUTE_MAP object across modules, but unfortunately it was deeply entangled in other logic.

Please consider this refactor, where pieces of logic are contained as a function in separate modules, AKA the Substack pattern.

Starting with f004806, we've been extracting code step by step. Every commit after passed tests and retained Drakov's functionality, so you could more easily follow our reasoning.

Kind regards,
@SiCurious and @kosmotaur

@yakovkhalinsky
Copy link
Contributor

Excellent PR 🎱 will definitely make it easier for the codebase going forward 👍

@yakovkhalinsky
Copy link
Contributor

Merging

yakovkhalinsky added a commit that referenced this pull request Jul 21, 2015
@yakovkhalinsky yakovkhalinsky merged commit 17bc102 into Aconex:master Jul 21, 2015
@kosmotaur
Copy link
Contributor Author

Thanks!

@yakovkhalinsky
Copy link
Contributor

Thank you very much for the PR 👍

I'll bump the npm version and publish, shortly.

@justingood justingood deleted the substack-pattern branch June 20, 2018 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants