function `getBucket`
function getBucket(bucketName: string, [areaName = 'local']) => BucketReturns a Bucket.
| import { Observable } from 'rxjs' | |
| export function log() { | |
| return function logFn<T>(source: Observable<T>) { | |
| const output = new Observable<T>((observer) => { | |
| const subscription = source.subscribe({ | |
| next: (val) => { | |
| console.log(val) | |
| observer.next(val) | |
| }, |
| export function uuidv4(): string { | |
| // @ts-ignore | |
| return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace( | |
| /[018]/g, | |
| (c: any) => | |
| ( | |
| c ^ | |
| (crypto.getRandomValues(new Uint8Array(1))[0] & | |
| (15 >> (c / 4))) | |
| ).toString(16), |
| import { Observable } from 'rxjs' | |
| interface TimeFn { | |
| (): number | |
| } | |
| export function dynamicInterval(timeFn: () => number)) { | |
| return new Observable(function subscribe(subscriber) { | |
| let count = 0 | |
| let id = setTimeout(handleTimeout, timeFn()) |
| // Position by ratio | |
| const xPos = 0.75 // 3/4 to the right | |
| const yPos = 0.5 // Centered vertically | |
| // Size of window | |
| const width = 480 | |
| const height = 305 | |
| // Create window | |
| await chromep.windows.create({ |
| function dayNo(y,m,d){ | |
| return --m>=0 && m<12 && d>0 && d<29+( | |
| 4*(y=y&3||!(y%25)&&y&15?0:1)+15662003>>m*2&3 | |
| ) && m*31-(m>1?(1054267675>>m*3-6&7)-y:0)+d; | |
| } | |
| Date.prototype.dayNo = function(){ var y=this.getFullYear(), m=this.getMonth(); return m*31-(m>1?(1054267675>>m*3-6&7)-(y&3||!(y%25)&&y&15?0:1):0)+this.getDate(); }; |
| import { useEffect, useState } from 'react' | |
| export function useDebounce<T>(value: T, delay: number) { | |
| // State and setters for debounced value | |
| const [debouncedValue, setDebouncedValue] = useState<T | undefined>() | |
| useEffect( | |
| () => { | |
| // Update debounced value after delay | |
| const handler = setTimeout(() => { |
function getBucket(bucketName: string, [areaName = 'local']) => BucketReturns a Bucket.
| import { AddActionConfig, AddManyActionConfig, ModifyActionConfig, PlopGenerator } from './index'; | |
| export const gen: PlopGenerator = { | |
| description: 'asfd', | |
| prompts: [], | |
| actions: [ | |
| { | |
| type: 'add', | |
| path: 'asfd', | |
| template: 'asfd', |
| { | |
| "header": { | |
| "reportVersion": 1, | |
| "event": "Allocation failed - JavaScript heap out of memory", | |
| "trigger": "FatalError", | |
| "filename": "report.20200527.152716.27614.0.001.json", | |
| "dumpEventTime": "2020-05-27T15:27:16Z", | |
| "dumpEventTimeStamp": "1590611236716", | |
| "processId": 27614, |
| import React from 'react' | |
| /** | |
| * Usage: | |
| * | |
| * <Compose components={[ | |
| * [BrowserRouter, browserValue], | |
| * [AuthProvider, authValue], | |
| * [ThemeProvider, themeValue], | |
| * [ChatProvider, chatValue] |