Giter Club home page Giter Club logo

Comments (4)

rsinghal avatar rsinghal commented on August 28, 2024

We could do something similar to OSD and structure our events like this:

var events = {
    'NS1' : {
        'handlers' : [NS1handler1, NS1handler2],
        'events' : {
            'event1' : [eventhandler1, eventhandler2],
            'event2' : []
        }
    },
    'NS2' : {
        'handlers' : [NS2handler1, NS2handler2],
        'events' : {
            'event3' : [],
            'event4' : []
        }
    }
}

Which allows us to handle events for an entire namespace.

And you can raise events like 'NS1:event2'.

from mirador.

aeschylus avatar aeschylus commented on August 28, 2024

Here is the article on which I based the annotation layer event system, after reading this little library, and the backbone events source code. And then there's the jQuery "custom" events, that, in theory, can use namespacing on objects

from mirador.

rsinghal avatar rsinghal commented on August 28, 2024

I like the tiny pub/sub you link to since it includes the namespacing we want. I'm happy to go with that. I think it'll nicely address our issues.

from mirador.

aeschylus avatar aeschylus commented on August 28, 2024

Okay. I pushed what I have for the workspaces this morning. I don't think
it will be especially helpful, as it represents several false starts. It
also have come to accept that a great deal on what we do with the event
mixin, as the workspaces and windows should be propagated from changes in
their parent models anyway. I think the pubSub plugin will work for us, we
just need to come up with a way to mix it in with a getter and setter
pattern à la issue #3 #3, so that that
behaviour can be "baked in", so to speak, for objects that need it. I am
finding it counterproductive to continue on this without doing a bad
first-pass, in order to then pick out the pieces that are abstractable and
generalise them. The workspaces idea is probably the most complicated place
to do that "make a first concrete example, then generalise" approach, so I
wonder if we could pair today on the Load Menu (which doesn't rely on any
of the workspace code until it needs to place something there), which seems
more straightforward as a first concrete application of the event system
code. Hopefully the outcome of that will be a finished mixin with an
established pattern for us to use for interface objects by the end of today.

On 6 May 2014 12:57, rsinghal [email protected] wrote:

I like the tiny pub/sub you link to since it includes the namespacing we
want. I'm happy to go with that. I think it'll nicely address our issues.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-42350926
.

from mirador.

Related Issues (20)

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.