Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
469068be
Commit
469068be
authored
Aug 09, 2017
by
yann300
Committed by
GitHub
Aug 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f4f46ea5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
best-practices.md
best-practices.md
+9
-15
No files found.
best-practices.md
View file @
469068be
# Current "Best Practice" Conventions
# Current "Best Practice" Conventions
*
look them up
*
discuss them
*
update them
-
`ES6 class`
rather than ES5 to create class.
-
`ES6 class`
rather than ES5 to create class.
-
CSS declaration using
`csjs-inject`
.
-
CSS declaration using
`csjs-inject`
.
-
HTML declaration using
`yo-yo`
.
-
HTML declaration using
`yo-yo`
.
-
`opt`
is an input parameter, it contains the
`api`
and
`event`
object.
-
`self._api = opts.api`
`opts.api`
is an object which contains functions/features that the module needs.
-
`opts.events`
contains events manager the module will listen on.
-
A module trigger events using
`event`
property:
-
A module trigger events using
`event`
property:
`self.event = new EventManager()`
. Events can then be triggered:
`self.event = new EventManager()`
. Events can then be triggered:
`self.event.trigger('eventName', [param1, param2])`
`self.event.trigger('eventName', [param1, param2])`
-
`opt`
is an input parameter:
```
{
api: { .. list of function needed by the module .. },
events: { .. list of event manager the module will listen on .. }
}
```
-
`self._api = opts.api`
`opts.api`
is an object which contains functions/features that the module needs.
-
`self._view`
is the HTML view renderered by
`yo-yo`
in the
`render`
function
-
`self._view`
is the HTML view renderered by
`yo-yo`
in the
`render`
function
-
`render()`
this function should be called:
-
`render()`
this function should be called:
At the first rendering (make sure that the returned node element is put on the DOM),
When some property has changed in order to update the view
*
At the first rendering (make sure that the returned node element is put on the DOM),
*
When some property has changed in order to update the view
-
look them up, discuss them, update them
## Module Definition (example)
## Module Definition (example)
```
js
```
js
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment