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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
isVisible: true | |
}); |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
attributeBindings: 'style'.w(), | |
style: '', | |
init() { | |
this._super(...arguments); | |
Ember.run.later(this, () => { | |
this.set('isVisible', true); |
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 Ember from 'ember'; | |
const { | |
String: { htmlSafe } | |
} = Ember; | |
export default Ember.Component.extend({ | |
attributeBindings: 'style'.w(), | |
style: '', | |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
attributeBindings: 'style'.w(), | |
init() { | |
this._super(...arguments); | |
Ember.run.later(this, () => { | |
this.set('isVisible', true); | |
}, 5000); |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
componentName: 'rd-block', | |
mods: null, | |
classNameBindings: ['componentName', 'modClassNames'], | |
modClassNames: Ember.computed('componentName', 'mods', 'mods.[]', { | |
get() { | |
let componentName = this.get('componentName'); | |
let mods = this.get('mods') || []; |
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
(async () => { | |
const relation = (ModelClass, deserialize, serialize) => { | |
return (target, key, descriptor) => { | |
const proto = Reflect.getPrototypeOf(target); | |
if (!target.hasOwnProperty(Symbol.for('#meta'))) { | |
if (proto.hasOwnProperty(Symbol.for('#meta'))) { | |
Reflect.defineProperty(target, Symbol.for('#meta'), {value: {...proto[Symbol.for('#meta')]}}); | |
} else { | |
Reflect.defineProperty(target, Symbol.for('#meta'), {value: {}}); | |
} |
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 isSupportSymbol = (symbolCode) => symbolCode === 55356 || (symbolCode >= 768 && symbolCode <= 879); | |
const reverse = (str) => { | |
let res = ''; | |
let prevSymbol = null; | |
for (const symbol of str) { | |
if (isSupportSymbol(symbol.charCodeAt())) { | |
res = `${prevSymbol}${symbol}${res}`; | |
prevSymbol = null; | |
} else if (prevSymbol == null) { | |
prevSymbol = symbol; |
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 IterableHash<G extends string | number, T> { | |
[key: string]: T; | |
[key: number]: T; | |
// @ts-ignore | |
private primaryKeyIndex: G[] = []; | |
// @ts-ignore | |
private data: Record<G, T | void> = {}; | |
// @ts-ignore |
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 { Transform } = require('stream'); | |
const sliceBySize = (buffer, size, callback) => { | |
let chunk = buffer.slice(0, size); | |
let index = size; | |
while (chunk.length >= size) { | |
callback(chunk); | |
chunk = buffer.slice(index, index + size); | |
index += size; |
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 type Listener<TContext> = (context: TContext) => Promise<void> | void; | |
export type MatcherFn<TEvent extends string> = (event: TEvent) => TEvent | null; | |
export class Matcher< | |
TEvent extends string, TAdditionalEvent extends string = 'DEFAULT', TContext = any, | |
> { | |
private _listeners: Map<TEvent | TAdditionalEvent, Listener<TContext>[]> = new Map(); | |
private _customMatchers: MatcherFn<TEvent | TAdditionalEvent>[] = []; |
OlderNewer