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.

What problem does this feature solve?

This interface might help when dealing with nested modules on stores using Typescript.

Currently the Module<S, R> interface exposes a single `ModuleTree<R>´ which allows us to create one level of nested modules.

Exposing a ModuleTree<R> or a ModuleTree<S, R> would be inline with the current GetterTree<S, R> and other Trees and allow us to deeper nest our Modules.

I ran into this issue when attempting to create a nested module within a nested module using Typescript. The “parent” modules holds state for some supported features on the application and its children require to check those features in order to validate their actions. The root state (or parent of the parent, in this case) simply holds environment and version information.

What does the proposed API look like?

I belive that a new interface ModuleTree<S,R> might solve the issue:

export interface ModuleTree<S, R> {
  [key: string]: Module<S, R>;
}

Which could be added to the Current Module<S, R> interface as an or:

export interface Module<S, R> {
  namespaced?: boolean;
  state?: S | (() => S);
  getters?: GetterTree<S, R>;
  actions?: ActionTree<S, R>;
  mutations?: MutationTree<S>;
  modules?: ModuleTree<R> | ModuleTree<S, R>;
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kiakingcommented, Mar 9, 2020

@rodolphocastro Exactly! Both getters and actions, the rootGetters refers to the real “root” getter. Not the parents 👍

0reactions
kiakingcommented, Mar 9, 2020

I think this issue is solved, so I’ll closing it. Thank you for your feedback! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uses of Interface jdk.nashorn.api.tree.ModuleTree (Java SE 9 & JDK ...
Nashorn parser API provides interfaces to represent ECMAScript source code as abstract syntax trees (AST) and Parser to parse ECMAScript source scripts.
Read more >
Module: Trees List
Makes windows listing trees and information about them. Author(s): Wayne P. Maddison and David R. Maddison; Version 3.70. Commands of Trees List.
Read more >
View Raw - UNPKG
ModuleTree<S>; }): void; } export declare function install(Vue: typeof _Vue): ... ModuleTree<R>; } export interface ModuleOptions { preserveState?: boolean; } ...
Read more >
bigmodelvis.visualization — OpenDelta 0.3.2 documentation
Module, tree:ModuleTree=None): r"""[NODOC] build the originial tree structure """ if self.is_leaf_module(module): return else: for n,m in ...
Read more >
Visualisation of large-scale expression data. (a) Module trees ...
(a) Module trees summarise the transcription modules identified by the ISA at different resolutions. ... Modular analysis of gene expression data with R....
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