Giter Club home page Giter Club logo

domino-v2-proposal's Introduction

domino.js v2 proposal (deprecated)

domino.js is an asynchronous JavaScript cascading controller for fast interactive Web interfaces prototyping, developped by Alexis Jacomy at Atelier Iceberg. It is released under the MIT License.

How to use it

To use it:

# Clone the repository
git clone [email protected]:jacomyal/domino.js.git

# Install dependencies (please first ensure you have NPM and Node.js installed)
npm install

# Build a minified version
grunt

domino-v2-proposal's People

Contributors

jacomyal avatar yomguithereal avatar

Watchers

 avatar  avatar  avatar

domino-v2-proposal's Issues

Types instantiation

It would be nice to be able to create types instances. An instance would be attributed to a given controller instance and it would be possible to register types through it.

[Idea]: properties fallback

Would it be useful to define a fallback value for some properties?

controller.registerProperty('prop1', {
  type: '?string',
  fallback: 'Hey, I am the fallback string!'
});

controller.update('prop1', false);

controller.get('prop1');
>>> 'Hey, I am the fallback string!'

Properties registration polymorphism

In old domino, properties would be stated thusly:

var d = new domino({
   properties: [
    {
        id: 'p1',
        type: 'string'
    },
    {
        id: 'p2',
        type: 'number'
    }
   ] 
});

So, for starters, we need a a posteriori low-level interface to deal with properties like:

d.addProperty({id: 'p3', type: 'number', namespace: 'x'});
// or
d.addProperty('p3', {type: 'number'});

And we could register properties likewise (considering namespaces also):

var d = new domino({
    properties: {
        ns1: {
            x: {
                type: 'number',
                description: 'a random number'
            },
            y: {
                type: 'string',
                defaultValue: 'Hello World!'
            }
        },
        ns2: {
            x: {
                type: 'number',
                description: 'This property is also x but is also namespaced.'
            },
            z: {
                type: 'object'
            }
        }
    } 
});

But now, what do we decide for polymorphism, that is to say, if we write something like the following:

var d = new domino({
    properties: {
        x: scalar
    } 
});

// or

d.addProperties('x', scalar);

I would advocate for property type, likewise:

var d = new domino({
    properties: {
        x: 'number'
    } 
});

// or

d.addProperties('x', 'number');

Controller events data

  1. I think that data in events is not unit tested
  2. When emitting an event with data, data is not correctly passed to the listeners (function _execute here is fishy and provide for undefined data to emitter.

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.