SUGGESTION: Function tree instances
See original GitHub issueHad 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:
- Created 7 years ago
- Reactions:1
- Comments:12 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
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 😃