Skip to content

Instantly share code, notes, and snippets.

@jasonaden
jasonaden / notes.md
Last active January 19, 2018 23:31
Updates to RxJS Types

Observer:

  • Seems like it's okay. There's PartialObserver<T> and Observer<T> as the main exports.
  • Subscription is currently a class implementation. ISubscription is closest to the spec, and AnonymousSubscription is any object returning an unsubscribe() method.
  • ISubscription should be renamed to Subscription. This means the current Subscription class (which is used almost exclusively in type position) would be renamed to RxSubscription. See description below in Observable for how RxSubscription and Subscription would be implemented and used.

Subscriber:

@jasonaden
jasonaden / notes.md
Last active January 5, 2018 14:44
common/router

@angular/common/router

Store

  • DONE Create RouterStore to hold RouteConfig objects
  • Helpers:
    • DONE getConfig(state: RouterState, id: number)

URL

@jasonaden
jasonaden / notes.md
Last active November 17, 2017 07:55
Angular Class Notes

Goals

  • Basic understanding of how to create an Angular application
  • Hands-on experience with fundamental pieces of the Angular platform
  • A good idea of "what's next" to continue learning journey

Links

@jasonaden
jasonaden / notes.md
Last active December 8, 2017 01:28
Angular Router Refactor Notes

ROUTER NOTES

The Angular router is loved for the features it provides, but is also a sore spot in terms of bugs, testability, edge cases causing errors during implementation, and bundle size. We would like to improve heavily on all these areas. Ideally this could be done without breaking changes so it could be released in v6. While some of the items below can be done in that way, there may be advantages to forking to a new package that would use the same concepts and much of the same core implementation, but do so with treeshakability and simplicity in mind to help address the sore spots.

These are some notes about how to get to this goal.

DESIGN

Testing Improvements

@jasonaden
jasonaden / webpack.config.js
Created October 12, 2017 17:22
Importing from 'rxjs/operators'
// Require the version of Rx you want to use (_esm5 or _esm2015)
const rxPaths = require('rxjs/_esm5/path-mapping');
var config = {
// Other config options...
resolve: {
extensions: [".ts", ".js"],
modules: [path.resolve('./src'), 'node_modules'],
// Use the "alias" key to resolve to an ESM distribution
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@jasonaden
jasonaden / integration.spec.ts
Created July 13, 2017 21:25
Test lazy named children
it('should allow lazy loaded module in named outlet',
fakeAsync(inject([Router, NgModuleFactoryLoader], (router: Router, loader: SpyNgModuleFactoryLoader) => {
@Component({selector: 'lazy', template: 'lazy-loaded'})
class LazyComponent {}
@NgModule({
declarations: [LazyComponent],
imports: [RouterModule.forChild([{path: 'lazy', component: LazyComponent}])]
})
var directive = ['$parse', function ($parse) {
var directive = {
restrict: 'A',
require: ['ngModel'],
link: link
};
return directive;
function link(scope, element, attr, ctrls) {
var ngModelController = ctrls[0];
searchTimeout = $interval(->
# Build more explicit query string to return better lucene results
# As of 2014-10-20 wildcard searches seem broken. i.e., `q=brendon+b*`
# returns a result as if it was `q=b*`, skipping all characters before
# the escaped space [ms]
formattedQuery = "#{queryString}*" unless hasSpace = / /.test queryString
if hasSpace
if css.isPhone(origQueryString)
formattedQuery = "phone:#{queryString}*"
else