![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Dependency injector, assembles application.
Registering, getting and setting components.
app.register 'component', -> 'some component'
console.log app.component
# => some component
app.component = 'another component'
console.log app.component
# => another component
Dependencies can be specified implicitly.
app.register 'a', ->
console.log 'initializing a'
'a'
app.register 'b', ->
console.log 'initializing b'
"#{app.a} b"
console.log app.b
# => initializing b
# => initializing a
# => a b
Or explicitly. The only difference with implicit approach is that explicit declaration will resolve circular dependencies (implicit approach will fail).
app.register 'a', ->
console.log 'initializing a'
'a'
app.register 'b', dependencies: ['a'], ->
console.log 'initializing b'
"#{app.a} b"
console.log app.b
# => initializing a
# => initializing b
# => a b
Component lifecycle callbacks.
app.register 'component', ->
console.log 'initialization'
'some component'
app.before 'component', -> console.log 'before initialization'
app.after 'component', -> console.log 'after initialization'
app.component
# => before initialization
# => initialization
# => after initialization
Scopes.
app.register 'params', scope: 'request', -> {}
startFiberSomehow ->
app.scope 'request', ->
app.params.key = 'some value'
console.log app.params
# => {key: 'some value'}
Scope callbacks.
app.beforeScope 'request', -> console.log 'before'
app.afterScope 'request', -> console.log 'after'
startFiberSomehow ->
app.scope 'request', ->
# => before
# => after
Require files in directory, provide watch: true
option to watch for changes and reload.
# /app/controllers/SomeController.coffee
# app.SomeController = 'some controller'
app.requireDirectory '/absolutePath/app/controllers', watch: true
console.log app.SomeController
# => some controller
Limitations.
app.get componentName
instead of app.componentName
in old browsers not supporting
getters and setters syntax. Use set
for setting components.Copyright (c) Alexey Petrushin, http://petrush.in, released under the MIT license.
FAQs
Dependency injector
The npm package micon receives a total of 0 weekly downloads. As such, micon popularity was classified as not popular.
We found that micon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.