GithubHelp home page GithubHelp logo

brendanjerwin / accessorizejs Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 0.0 268 KB

Add observable accessors to any object.

Home Page: www.accessorizejs.com

Ruby 1.88% CoffeeScript 24.19% JavaScript 73.93%

accessorizejs's People

Contributors

brendanjerwin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

accessorizejs's Issues

Provide assorted release packages

Need a few different forms for release:

  • A CommonJS amd module which requires a module called _
  • A CommonJS amd module which doesn't require _. This version will not have _ integration.
  • A global-namespaced version that creates the GLOBAL.accessorize object. This version will look for a GLOBAL._ and use it if it exists to provide _ integration. It will also allow one to set accessorize._ if needed.

Add custom getter/setter logic

AOP style?

Add the ability to provide custom logic for the setter/getters of accessors.

This is how a computed property can be implemented.

Property-style data access protection semantics.

Read Only seems like the most obvious. But all three modes should be made available: Read/Write, Read Only, Write Only.

Should this only be available for adjustment at the original accessorization?

Enable pause/continue updates ability

On either the wrapped object or individual accessor level, add ability to pause updates for performance reasons. Continue should only fire the change event once for each changed accessor/wrapper.

Perhaps a throttle approach would work as well/better?

Integrated support for property value validation on set.

Should add validators to a list on the accessorized object.
Bound to one or more properties, will execute when any of the bound values are being set. Can prevent a set from happening. No change notification will occur if the set is aborted.
Needs to deal with validation of the entire model and with validation of a single property.

Chaining syntax

Like ko has on its observables:

"To write values to multiple observable properties on a model object, you can use chaining syntax. For example, myViewModel.personName('Mary').personAge(50) will change the name value to 'Mary' and the age value to 50."

Port tests from vows to jasmine

It makes sense, this is intended to run in a browser... I'll use jasmine-node or something to get the nice dev-time experience back.

Underscore Integration

If underscore is available, when an accessor is created, create an
underscore wrapper for the backing value and then mix in its methods
directly on the accessor.

Perhaps a black-list will be needed...

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.