Skip to content

Instantly share code, notes, and snippets.

View aryanshridhar's full-sized avatar
🎯
Focusing

Aryan Shridhar aryanshridhar

🎯
Focusing
View GitHub Profile
@aryanshridhar
aryanshridhar / App.js
Created April 12, 2020 07:18
Context Api in React.js
import React, { Component } from 'react'
import Child from './Child.js'
export const ContextApi = React.createContext();
export default class App extends Component {
state = {
language : "Javascript",
Framework : 'React.js'
}
It was the best of times,
it was the worst of times,
it was the age of wisdom,
it was the age of foolishness,
it was the epoch of belief,
it was the epoch of incredulity,
it was the season of Light,
it was the season of Darkness,
it was the spring of hope,
it was the winter of despair,
This file has been truncated, but you can view the full file.
First Citizen:
Before we proceed any further, hear me speak.
All:
Speak, speak.
First Citizen:
You are all resolved rather to die than to famish?
All:
const electron = require('electron')
const {app, BrowserWindow , Menu , MenuItem , Tray , session, ipcMain ,screen} = electron;
const windowState = require('electron-window-state')
global['myglob'] = 'A var set in main.js'
let tray;
function createTray(menu){
tray = new Tray('tp.png')
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const remote = require('electron').remote
const { app, dialog, BrowserWindow } = remote
const {webFrame , desktopCapturer , ipcRenderer} = require('electron');
const {screen } = remote;
const {shell , nativeImage , clipboard} = require('electron');
import $ from "jquery";
import render_dropdown_list from "../templates/settings/dropdown_list.hbs";
import * as blueslip from "./blueslip";
import * as ListWidget from "./list_widget";
export function DropdownListWidget({
widget_name,
data,
import $ from "jquery";
import render_dropdown_list from "../templates/settings/dropdown_list.hbs";
import * as blueslip from "./blueslip";
import * as ListWidget from "./list_widget";
import _ from 'lodash';
export function DropdownListWidget({
export function MultiSelectDropdownListWidget({
widget_name,
data,
default_text,
null_value = null,
on_update = () => {},
value,
limit,
}){
// A widget mostly similar to `DropdownListWidget` but
import $ from "jquery";
import _ from "lodash";
import render_dropdown_list from "../templates/settings/dropdown_list.hbs";
import * as blueslip from "./blueslip";
import * as ListWidget from "./list_widget";
export function DropdownListWidget({
widget_name,
export function DropdownListWidget({
widget_name,
data,
default_text,
render_text = (item_name) => item_name,
null_value = null,
include_current_item = true,
value,
on_update = () => {},
}) {