GithubHelp home page GithubHelp logo

angular-falcor's People

Contributors

rolaveric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

angular-falcor's Issues

Remove rx-angular as a dependency

Right now the only purpose rx-angular serves is to add the safeApply() method to Rx.Observable.prototype.
However there's two problems with this:

  1. The $scope.$$phase check that safeApply() uses is considered bad practice, compared to using $timeout() or $scope.$evalSync(): http://www.bennadel.com/blog/2605-scope-evalasync-vs-timeout-in-angularjs.htm
  2. Falcor will soon be removing the RxJS library from it's core, so monkey patching Rx.Observable.prototype will no longer be viable: Netflix/falcor#465

Unit Tests

Create some unit tests (tsk tsk), especially ones that show how to mock the falcor.Model data since we don't have $httpBackend to rely on.

One option would be to rely on models being wrapped up as angular services, so they're injectable singletons. Then unit testing is a simple matter of swapping out for a mock version.
A standard factory for mock models would be useful. We can't just use a falcor.Model with preset cache for two reasons:

  1. model.call() won't work without a router.
  2. If values are always ready in cache, we can't test the behaviour when waiting for a request to fill in that cache.

ng-model example

Change the example to use inputs with ng-model that then get/set from the falcor model.

One option may be to create a model.createGetterSetter(path) method which generates functions that can get or set a path value, depending on whether a parameter is passed or not.
These functions could then be used with ng-model-options="{ getterSetter: true }": https://docs.angularjs.org/api/ng/directive/ngModel#binding-to-a-getter-setter
This will require the controller to setup those getterSetter functions though - no getting around that.

Another option may be to create a directive which uses the ngModelController: https://docs.angularjs.org/api/ng/type/ngModel.NgModelController

Benchmark

Should apply some performance analysis on the AngularJS falcor service.

  • Profile the getViewValue() and viewGetterSetter() methods, looking for memory leaks and optimisations. eg. I suspect the inProgress cache is redundant.
  • Benchmark how getViewValue() and viewGetterSetter() run at scale. eg. 5 vs 50 vs 500. Benchpress may be a good tool to use.

Create library

Approaching a point where the code may be reusable in other projects.
Should wrap the reusable code into library and move the example code into an 'example/' folder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.