Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.
I've tried to make it as lean and unobtrusive as possible.
errors/AppError.js
Important: At the time of writing (2019-11-11) Immutable.js is effectively abandonware, so I can no longer recommend anyone to follow the advice given here. I'll leave the article here for posterity, since it's still getting some traffic.
Functional programming principles and with it immutable data are changing the way we write frontend applications. If the recent de-facto frontend stack of React and Redux feels like it goes perfectly together with immutable data, that's because it's specifically designed for that.
There's several interesting implementations of immutable data for JavaScript, but here I'll be focusing on Facebook's own Immutable.js, and specifically on one of i
//navigate to the ext js 6 folder | |
sencha package upgrade | |
sencha generate app -s templates/admin-dashboard/ Dashboard ../my-folder |
var o = {}; | |
// include the modules you want - purposely did this as seperate lines so it's easier to comment out modules etc | |
_.extend(o, require("module1")); | |
_.extend(o, require("module2")); | |
_.extend(o, require("module3")); | |
// make available under a single export for use in <Alloy> tag | |
module.exports = o; |
Update: https://github.com/phracker/MacOSX-SDKs hosts the direct SDK folders already extracted.
Xcode 4.3.3
Show Package Content
/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
actions=true | |
ads=true | |
analytics=true | |
appindexing=true | |
appstate=true | |
auth=true | |
cast=true | |
common=true | |
drive=false | |
dynamic=true |
// now you can use it in a titanium app | |
useSomeApi(Ti.App.Properties.getString('SOME_API_KEY')); |
// The base controller event handler, which will get overridden by the derived one | |
exports.doClick = function(e) { | |
alert('base click handler'); | |
}; | |
// We have to wait until the object is initialized before applying the event listener. This is so | |
// the derived listener is used, not the base one. Also, "$" must be used instead of "exports", to | |
// ensure that the overridden instance of the controller's "doClick" is used, not the exported | |
// version of the function from the base controller. | |
exports.init = function(e) { |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
//single calls over bridge | |
var osname = Ti.Platform.osname, | |
version = parseInt(Ti.Platform.version); | |
//simple boolean checks | |
var isandroid = function() { | |
return osname === 'android'; | |
}; | |
var isios = function() { |