create (class method)

Creates a new DataSource instance with the specified options or returns the first parameter if it is a DataSource object:

//first argument can be an object of settings or a DataSource instance
var dataSource = new shield.DataSource.create({ data: [/*...*/] });

Note: This method ensures that, whenever we need to work with DataSource objects, we have a way to reliably retrieve a DataSource instance regardless of whether we already have one at hand or we have the initialization options instead. This approach is suitable for retrieving DataSource instances in widget constructors, where we are not sure whether options is a plain object or a DataSource instance already.