Sha256: 90c120073366ba34f77463ca2089d2e3a0b2ef9a98ff368480538efd9b439dee
Contents?: true
Size: 1.45 KB
Versions: 25
Compression:
Stored size: 1.45 KB
Contents
'use strict' define 'aura/extensions/domain', -> # The purpose of this extension is have a business domain practice # integrated with the core application functionality version: '0.1.0' initialize: (application) -> {core: {mediator, stamp}} = application eventable = stamp on : mediator.on off : mediator.off once : mediator.once many : mediator.many emit : mediator.emit unlisten: mediator.removeAllListeners domainable = stamp() # application.use('extensions/models').use 'extensions/widget/flows' # TODO detect if flows extension and models extension have already been loaded # TODO require domain commands application.domain ||= eventable() afterAppStart: (application) -> {core: {resourceable: {every: resourceables}, Widgets: {Flow}, stamp, stamps}, domain} = application # TODO disponibilize the resourceables method through the resources extension extensions = {} for resourceable in resourceables resource = resourceable.resource.toString() namespaces = resource.split '/' method = namespaces.pop() + 'able' # Create namespaces node = extensions for namespace in namespaces node[namespace] ||= {} node = node[namespace] node[method] = resourceable stamp 'resourceables', extensions Flow.compose stamp.compose stamps.resourceables, stamp().enclose -> domain[@name] = @
Version data entries
25 entries across 25 versions & 1 rubygems