This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"body": { | |
"results": { | |
"uri": "https://qa-api.hotstar.com/o/v1/page/2735?offset=0&size=10&tao=0&tas=10", | |
"pageType": "NAVIGATION_LANDING_PAGE", | |
"responseType": "TRAY_LIST", | |
"trays": { | |
"items": [ | |
{ | |
"title": "news masthead yash", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"response": { | |
"2xx": { | |
"type": "object", | |
"properties": { | |
"statusCode": { | |
"type": "string" | |
}, | |
"statusCodeValue": { | |
"type": "integer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const mobileRenderable = function (target, name, descriptor) { | |
//Do this only on client side | |
if (canUseDOM) { | |
console.log('mobileRenderable getting applied client') | |
const originalRender = target.prototype.render | |
let mobileRender = target.prototype.renderMobile | |
//Throw warning if user has used mobileRenderable but have not provided renderMobile | |
if (!mobileRender) { | |
console.warn(target, ' is decorated with mobileRenderable but renderMobile function is not provided. Regular render will be used.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const mobileRenderable = function (target, name, descriptor) { | |
const originalRender = target.prototype.render | |
let mobileRender = target.prototype.renderMobile | |
//Device identification | |
let device = deviceIdentification().formFactor || 'desktop' | |
let functionToCall = null | |
if (device === 'mobile') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mobileRenderable | |
class MyComponent extends React.Component { | |
renderMobile(){ | |
return(<div>Aswesome My Component rendered for mobile </div>) | |
} | |
render(){ | |
return(<div>Awesome My Component</div>) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyComponent extends React.Component { | |
render(){ | |
return(<div>Awesome My Component</div>) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dataUpdatePromise = $q.defer(); | |
var params = { | |
"sportId": 1, //Cricket | |
"callerId": "scores-tray-caller-id", //TODO : Create constant for this | |
"onSportsDataLoad": function(data) { | |
data.matches = prepareMatchesForView(data.matches); | |
deferred.resolve({ | |
docs: data.matches, | |
matches: data.matches, | |
numFound: data.matches.length, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
angular.module('hotStar.multisportSDKManager', ['hotStar.utils']) | |
.factory('MultiSportManager', ['$filter', '$rootScope', 'Utils', 'Configuration', '$location', '$cookies', '$q', 'BaseConfig', function($filter, $rootScope, utils, configuration, $location, $cookies, $q, baseConfig) { | |
var sdk; | |
var deferred = $q.defer(); | |
var multisportSDK = { | |
initSDK: function() { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sum(){ | |
var args = Array.prototype.slice.call(arguments); | |
var total = 0; | |
var highestDecimalPoints = 0; | |
var sanitizedArray = []; | |
args.forEach(function(no){ | |
if(!isNaN(no)){ | |
//If no is decimal | |
if(no % 1 > 0){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gco # git checkout | |
grhh # git reset --hard | |
ggpush # git push origin $(current_branch) | |
gpu # git push upstream |
NewerOlder