What is a module?#
A module is a set of method operations. You can
require it and call its methods. During the initialization of WeexSDK, some internal modules have already been registered by the engine.
Native module registration process#
stream module: it provides a method called
fetch which can invoke a network request to specified server. You can get more details here.
var stream = weex.requireModule('stream');
Difference between module method and component method#
For a module method, you can call the method after require and it doesn’t rely on any component instance. For component method, you must get the ref for component first and then call the component method