This file contains 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 } from '@angular/core'; | |
import { ComButtonComponent } from '../../../../common/button'; | |
import { | |
ComFormComponent, | |
ComFormGroupComponent, | |
ComFormInputComponent, | |
ComFormActionsComponent, | |
ComFormCheckboxComponent | |
} from '../../../../common/form'; | |
import { ActivatedRoute } from '@angular/router'; |
This file contains 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 { ReplaySubject } from 'rxjs'; | |
function StorageWrapper(storage) { | |
function set(key, value) { | |
storage.setItem(key, JSON.stringify(value)); | |
return value; | |
} | |
function get(key) { | |
return JSON.parse(storage.getItem(key)) |
This file contains 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 main({ DOM, HTTP, storage }) { | |
const loginRequest$ = Observable.of({ | |
category: 'tokens', | |
url: 'someUrl', | |
method: 'POST', | |
send: { | |
data: { | |
type: 'tokens', | |
attributes: { | |
email: 'some@email.io', |
This file contains 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
'use strict'; | |
import { run } from '@cycle/rxjs-run'; | |
import { makeDOMDriver, div, input, p, li, ul, span, h2, h5, label, hr } from '@cycle/dom'; | |
import { makeHTTPDriver } from '@cycle/http'; | |
import { Observable } from 'rxjs'; | |
import isolate from '@cycle/isolate'; | |
function intent(DOMSource) { | |
return DOMSource.select('.checkbox').events('click') |
This file contains 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
// why are you passing this 'currentStatus' from the view (first element in the array) if it's | |
// not being used here anywhere? You only use status and productId to dispatch the action; | |
// BTW: don't use array indices like arr[0], arr[1] ;-) that's not the reactive way. | |
this.onReject$ | |
.switchMap(([currentStatus, status]: string[]): Observable<any> => | |
this.product$.filter(Boolean).first().map((product: any) => { | |
const productId = product.get('id'); | |
return { currentStatus, status, productId }; | |
}) |
This file contains 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 compose(...fns) { | |
return arg => fns.reduceRight((prev, curr) => curr(prev), arg); | |
} | |
const fatherMixin = (BaseClass = class {}) => | |
class Father extends BaseClass { | |
constructor() { | |
super() | |
this.frontendLang = 'JavaScript'; | |
} |
This file contains 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
// Elixir | |
data = [ | |
%{ id: 1, value: 0 }, | |
%{ id: 2, value: 0 }, | |
%{ id: 3, value: 0 } | |
] | |
Enum.map data, fn item -> | |
if item.id == 2 do | |
%{ item | value: item.value + 1 } |
This file contains 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
angular | |
.module('myApp', []) | |
.factory('DataFactory', function DataFactory($q) { | |
return { | |
getData() { | |
return $q.when([ | |
{id: 1, name: 'A'}, | |
{id: 2, name: 'B'}, | |
{id: 3, name: 'C'}, | |
{id: 4, name: 'D'}, |
This file contains 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 * as React from 'react'; | |
import * as R from 'ramda'; | |
import { connect, Dispatch } from 'react-redux'; | |
import { bindActionCreators } from 'redux'; | |
import { Title } from '../../shared/components/title'; | |
import { StuffTypeItems } from '../../shared/components/subscription-calculator'; | |
import { Button } from '../../shared/components/button'; | |
import { ItemComponent } from './stuff-type/item'; | |
import { setStuffType, SubscriptionCalculatorActions } from '../store/subscription-calculator.actions'; |
This file contains 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 from 'react'; | |
const ListWrapper = ({ children }) => ( | |
<div className='people-list-wrapper'> | |
<ul className='people-list'> | |
{children} | |
</ul> | |
</div> | |
); |
OlderNewer