-
-
Notifications
You must be signed in to change notification settings - Fork 151
Style Guide
David Scrobonia edited this page Sep 17, 2017
·
5 revisions
Promises should be styled according to this guide by Dave Atchley
jslint will run on all pull requests.
All tools require:
- a label for the button
- an icon for the button
- initializeStorage function that saves tool data to indexeddb
- listener for activate event that calls initializeStorage
- listener for message events
- using the module pattern
- exposing the name
- add the module to the service worker's self.tools object using the name as the key
When sending postMessages between components they typically follow the same structure. The action property is what the receiving componet will use to determine what function to call, and the field properites are used to pass along any other information needed for that function.
var message = {
action: "nameOfAction",
field1: "fieldData1",
field2: "fieldData2"
}