- Require
jade
,coffee
,less
cordova.js
should be loaded externally- Copy file assets (png,jpg,ttf,etc) rather than hashing them.
- Multiple, independant bundles:
/src/[name]/main.js --> /dist/[name]/bundle.js
##Enhancements:
/** | |
* Copy-paste this in your console to test if function works as expected | |
**/ | |
function toNodejsFn(cordovaFn,self){ | |
return function(){ | |
var args = Array.prototype.slice.call(arguments,0); | |
var callback = args.splice(args.length-1,1)[0]; | |
args.push(function onSuccess(){ | |
var args = Array.prototype.slice.call(arguments, 0); | |
args.unshift(null); |
##API idea
Promises support:
isResolved
attribute, which is false when the promise has been started but not yet resolved.// In your parent | |
import placeholderfunction from "./placeholderfunction"; | |
class Parent extends Component { | |
// A placeholder function is a function that is not yet implemented | |
save = placeholderfunction(); | |
render() { | |
<button onClick={this.save}>Save</button> | |
<Child save={this.save} /> |