Skip to content

Add a section about Types global namespace #97

@piotrwitek

Description

@piotrwitek

Issuehunt badges

We would need a new section explaining how I designed cross-cutting Types global project namespace to be easily reused across the project as a module encapsulating all the types in the application.
I leveraged the inversion of control principle, so instead of defining all the types in one place (in Types module, it's the responsibility of modules (which are owners of that particular type annotations) to extend the Types namespace.

The main benefits are:

  • simplicity to extend
  • easy maintenance - for instance when you remove some application module you also delete the extension point because it's colocated with the module
  • nicely and cleanly imported in type consumers
import Types from 'Types';
// reducer(state: Types.RootState , action: Types.RootAction) => ...
// mapDispatchToProps(dispatch: Dispatch<Types.RootAction>)
// Epic<Types.RootAction, Types.RootState, Types.Services>

IssueHunt Summary

Backers (Total: $40.00)

Submitted pull Requests


Become a backer now!

Or submit a pull request to get the deposits!

Tips

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy