This file contains hidden or 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 Configuration { | |
calendar: Calendar; | |
constructor(config: ConfigurationArgs) { | |
switch (config.os) { | |
case 'ios': | |
this.calendar = new AppleCalendar(); | |
break; | |
case 'chromeos': | |
this.calendar = new GoogleCalendar(); |
This file contains hidden or 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 Configuration { | |
calendar; | |
constructor(config) { | |
switch (config.os) { | |
case 'ios': | |
this.calendar = new AppleCalendar(); | |
break; | |
case 'chromeos': | |
this.calendar = new GoogleCalendar(); |
This file contains hidden or 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 Application { | |
calendar; | |
constructor(calendar) { | |
this.calendar = calendar; | |
} | |
run() { | |
this.calendar.createEvent({name: 'Abstract Factory Pattern', date: new Date(), participants: []}); | |
} |
This file contains hidden or 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 OutlookCalendar { | |
createEvent({name, date, participants}) { | |
MicrosoftAPI.createEvent({title: name, date, users: participants}); | |
} | |
} |
This file contains hidden or 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 AppleCalendar { | |
createEvent({name, date, participants}) { | |
AppleAPI.createEvent({name, date, participants}); | |
} | |
} |
This file contains hidden or 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 GoogleCalendar { | |
createEvent({name, date, participants}) { | |
GoogleAPI.createEvent({title: name, date, invitees: participants}); | |
} | |
} |
This file contains hidden or 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
import {Dimensions} from 'react-native'; | |
import {BaseGroup} from './base_group'; | |
import {Boundaries} from './boundaries'; | |
export class WorldBoundaries extends BaseGroup { | |
constructor() { | |
super(); | |
this.objects.push( |
This file contains hidden or 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
import {useLayoutEffect, useState} from 'react'; | |
import {Dimensions, View} from 'react-native'; | |
import {Pointer} from '../../helpers/pointer'; | |
export class BaseGroup extends Pointer { | |
objects = []; | |
ref = null; |
This file contains hidden or 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
import {Dimensions} from 'react-native'; | |
import {Base} from './base'; | |
export class Boundaries extends Base { | |
constructor({top, left}) { | |
super({ | |
physicalAttributes: { | |
top, | |
left, | |
width: Dimensions.get('window').width, |
This file contains hidden or 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
import React, {useLayoutEffect, useRef} from 'react'; | |
import { | |
Button, | |
Dimensions, | |
ImageBackground, | |
Pressable, | |
SafeAreaView, | |
StyleSheet, | |
View, | |
} from 'react-native'; |