See here instead https://github.com/vsavkin/ngselectors
Say we have a store defined as follows:
export class Store {
Say we have a store defined as follows:
export class Store {
import { ApolloStore } from 'apollo-client'; | |
import { Store } from '@ngrx/store'; | |
import { skip } from 'rxjs/operator/skip'; | |
import { take } from 'rxjs/operator/take'; | |
export function toApolloStore(store: Store<any>): ApolloStore { | |
return { | |
subscribe(fn: () => void): () => void { | |
const futureStates$ = skip.call(store, 1); |
""" The problem description: | |
Given a Data Structure having first n integers and next n chars. | |
A = i1 i2 i3 ... iN c1 c2 c3 ... cN.Write an in-place algorithm | |
to rearrange the elements of the array ass A = i1 c1 i2 c2 ... in cn | |
""" | |
def swap(arr, ind1, ind2): |
用例子讲解 RxJS 5 的 Operators 。
// Type definitions for Feathers | |
// Project: http://feathersjs.com/ | |
// Definitions by: Jack Guy <http://thatguyjackguy.com> | |
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | |
import { Application, Handler, ErrorRequestHandler } from 'express'; | |
type HandlerArgument = Handler | Handler[]; | |
export = Feathers; |
// Something like this. I haven't tested this file | |
@Injectable() | |
export class ApiService { | |
constructor(public _http: Http, public _cache: Cache) { | |
} | |
// whatever domain/feature method name | |
getModel(url) { | |
// you want to return the cache if there is a response in it. This would cache the first response so if your API isn't idempotent you probably want to remove the item from the cache after you use it. LRU of 1 |
// Type definitions for Meteor 1.3 | |
// Project: http://www.meteor.com/ | |
// Definitions by: Dave Allen <https://github.com/fullflavedave> | |
// Definitions: https://github.com/borisyankov/DefinitelyTyped | |
/** | |
* These are the common (for client and server) modules and interfaces that can't be automatically generated from the Meteor data.js file | |
*/ | |
interface EJSONable { |
/* | |
Add package: | |
meteor add votercircle:winston | |
Then use in server or client code as | |
logger.[debug|info|warn|error] | |
*/ | |
if(Meteor.isServer) { | |
//- Ref: https://atmospherejs.com/votercircle/winston | |
//- Setup Winston logging |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/test'); | |
var schema = new mongoose.Schema({ | |
name: String, | |
email: String, | |
random: {type: [Number], default: function(){ return [Math.random(), Math.random()]}, index: '2d'} | |
}); |
// USING: | |
// import Messenger from './Messenger' | |
// <Messenger news={['your', 'array', 'with', 'strings', 'here']}/> | |
import React, { Component } from "react"; | |
export default class Messenger extends Component { | |
state = { | |
mainMessage: "", | |
codeletters: "&#*+%?£@§$", |