GithubHelp home page GithubHelp logo

config-one's People

Contributors

klortho avatar

Watchers

 avatar  avatar

Forkers

gitter-badger

config-one's Issues

Add an `atomTests` option

This is one possible way to address the issue of class instances not being represented faithfully by views, and losing their prototype when getting copied.
With this idea, you could extend config-one on the fly, before you use it. E.g.

      // Extend config-one on the fly, to tell it to treat tinycolor objects
      // as atomic.
      const C1 = TreeChart.config1.new({
        atomTests: [
          obj => obj instanceof tinycolor,
        ],
      });

But I ran into a problem: many of the methods in seed.js are not being invoked as methods. So nodeType() is not getting a reference to the current config1 object, so it has no access to the options for that object.

I started trying to go through and systematically make sure everything's getting called as a method when it should, in this commit, but it is a bit messy, and I'm afraid of breaking something.

It should be done eventually, though.

For now, another way suggests itself: attach an ES6 symbol to the tinycolor constuctor.

wish: docs should clarify how array merging works

An array is shown in an example, so it would be help to clarify how array merging works.

Consider these two arrays in a parent and child configuration. How should they be merged?

// parent
[ 'a','b','a','b','a']

// child
[null,'a','b']

Should the child's array replace the parent's array wholesale?

Should we assume that the the positions in the second array correspond to those in the parent? How then would we express removing the first elements of the array in the child? How can we tell which 'a','b' in the child corresponds to 'a', 'b' values in the parent?

The node-config solution was not provide a simple predictable results: Values in arrays in arrays are not merged (even if they are deeply nested objects). An array in the child always replaces an array in the parent.

This is occasionally inconvenient, but wins for being simple and dependable.

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.