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 { Component, useState } from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
template: <div class='App'> Counter: {{ counter }} <br /> <app-button (click)="onClick()"></app-button> </div> , | |
styles: [] | |
}) | |
export class AppComponent { | |
counter = 0; |
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, { useState } from 'react'; | |
function Button(props) { | |
return <button onClick={props.onClick}>Click me</button> | |
} | |
export function App(prps) { | |
const [counter, setCounter] = useState(0); | |
const onClick = () => {setCounter(counter + 1 )} |
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
function objectsEqual(a, b) { | |
return JSON.stringify(a) === JSON.stringify(b); | |
} |
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
const numbers = [1,2,3,4,5,6]; | |
function findOdd(nums) { | |
nums % 2 | |
} |
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
export class _Core { | |
// static property to store instance of the _Core class | |
private static _instance?: _Core; | |
// private property to store an instance of the _Interfaces.Messaging class | |
private readonly messaging: _Interfaces.Messaging; | |
// constructor to create an instance of the class and initialize messaging property | |
constructor() { | |
this.messaging = FirebaseMessaging.default(); |
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, { useState } from 'react'; | |
import { View, TextInput, Button, StyleSheet } from 'react-native'; | |
const SignInScreen = () => { | |
const [email, setEmail] = useState(''); | |
const [password, setPassword] = useState(''); | |
const handleSignIn = () => { | |
// Sign in logic here | |
console.log(email, password); |
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 { _Core, _Interfaces } from './_Core'; | |
describe('_Core', () => { | |
const mockMessaging = { | |
registerDeviceForRemoteMessages: jest.fn(() => Promise.resolve()), | |
getToken: jest.fn(() => Promise.resolve('mockToken')), | |
requestPermission: jest.fn(() => Promise.resolve(_Interfaces.AuthorizationStatus.AUTHORIZED)), | |
}; | |
beforeEach(() => { |
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
export class _Core { | |
private static _instance?: _Core; | |
private readonly messaging: _Interfaces.Messaging; | |
constructor() { | |
this.messaging = FirebaseMessaging.default(); | |
} | |
public static get instance(): _Core { |
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
const prototype: Prototype = { | |
greeting: "Hello!", | |
greet: function() { | |
console.log(this.greeting); | |
}, | |
clone: function() { | |
return Object.create(this); | |
}, |
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
interface Prototype { | |
greeting: string; | |
greet: () => void; | |
clone: () => Prototype; | |
} |
NewerOlder