UNPKG

2.27 kBMarkdownView Raw
1## Planed Features
2
3_This is a discussion-File, feel free to make a pull-request with suggestions_
4
5### Improvements
6- Use ES6 module-system
7- Advance testing-strategy (there is still more potential)
8- Implement Feature/UI-Tests
9- Add some examples
10- Fill README files in folders and link to the global README
11
12
13### Features
14**Implemented**
15```javascript
16// ## Define Command
17both.command('Feed:Like', function(payload){
18 // Update Feed-Entry e.g. mysql/mongo stuff
19});
20```
21
22
23**Implemented**
24```javascript
25// ## Define Query
26both.query('Feed:Likes', function(payload){
27 // Find all likes in database an return those
28});
29```
30
31
32**Implemented**
33```javascript
34// ## Execute Commands
35both('Feed:Like', {}, function(){});
36```
37
38
39**Implemented**
40```javascript
41// ## Execute Queries
42both('Feed:Likes', {}, function(){});
43```
44
45
46**Planed**
47```javascript
48// ## Execute command by clicking on the button - if successful, do some UI-Stuff
49$('#createTodoButton').on('click', function(){
50 both('CreateToDo', 'Clean your room')
51 .on(function(){
52 $(this).val('Todo Created!')
53 });
54});
55```
56
57
58**Planed**
59```javascript
60// ## Execute multiple Tasks
61
62// # Idea A
63both({
64 'Todo:Create': {},
65 'Notification:TodoCreated': {}
66});
67
68// # Idea B
69both([
70 'Todo:Create', () => {}
71],[
72 'Todo:UpdateCounter', () => {}
73]);
74```
75
76
77
78**Planed**
79```javascript
80// ## Command Event-Listener
81both.on('Feed', (payload) => {});
82```
83
84
85**Planed**
86```javascript
87// ## Command-Specific Event-Listener
88both.on('Feed:Like', function(payload){});
89```
90
91
92**Implemented**
93```javascript
94// ## Global Event-Listener
95both.on(function(payload){});
96```
97
98
99**Implemented**
100```javascript
101// ## Use middleware to simply use connectors
102// Socket
103both.use(io) // Frontend
104both.use(socketio) // Backend
105```
106
107
108**Implemented**
109```javascript
110// ## Register whatever in global registery, so the modules can call it for registered commands/queries/listeners
111both.register('command', {
112 name: 'ExampleCommand',
113 func: function(){ 'some function' }
114});
115```
116
117
118**Planed**
119## Execute methods from CLI
120Defined Command:
121```javascript
122both.command('createToDo', function(name, args, callback){
123 // args:
124 // [0] Eat Pizza
125 // [1] Tomorrow
126 // [2] My Kitchen
127});
128```
129Execute:
130`$ both createToDo -args 'Eat Pizza, Tomorrow, My Kitchen'