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.

SUGGESTION: Function tree instances

See original GitHub issue

Had some discussions on how function-tree can be a bit friendlier about creating more instances, typically for server side usage.

The API change would be:

const FunctionTree = require('function-tree')

const myFunctionTree = new FunctionTree({
  // Add directly to context (ContextProvider)
},
[
 // Providers
])

// Global listeners
myFunctionTree.on('EVENT', () => {})

const run = myFunctionTree([
  // Some tree definition
])

// Specific tree listeners
run.on('EVENT', () => {})

// Run tree, returns a promise
run({foo: 'bar'})
  .then(() => {})
  .catch(() => {})

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
maxfriggecommented, Mar 8, 2017

@christianalfoni got it. will be experimenting with tree in tree this week and let you know how it goes. I think that especially in node environments this could be quite handy.

1reaction
christianalfonicommented, Mar 3, 2017

Yes, exactly 😃 Basically you kinda bind a tree to an execution allowing you to listen to events for only that specific tree execution, instead of only globally like it does now.

Also returning a promise allows you to use this as middleware for example 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto-complete feature using Trie - GeeksforGeeks
Recursive function to print auto-suggestions for given. // node. void suggestionsRec( struct TrieNode* root,. string currPrefix).
Read more >
Functional Trees - Springer Link
Given a set of examples and an attribute constructor, the general algorithm used to build a functional tree is presented in figure 1....
Read more >
System Design: Typehead Suggestion | by Gul Ershad | ITNEXT
A functional requirement characterises products features or functions. It is predominantly focused on the requirements of its system or components. This should ...
Read more >
Issue Trees: The Definitive Guide [+In-depth Examples]
In this COMPREHENSIVE guide, you'll learn 3 powerful techniques to build Issue Trees for case interviews, see TONS of realistic examples and much...
Read more >
15 Tree-based models | Exam PA Study Guide, Spring 2022
Decision trees can be used for either classification or regression problems. The model structure is a series of yes/no questions. Depending on how...
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