Skip to content

0.30.0

Compare
Choose a tag to compare
@aliokan aliokan released this 04 Oct 06:40
· 6 commits to master since this release

Features

State behaviors can be described with flow

Simple example with native states transitions
@context( name = 'applicationContext' )
{
	assemblingStart = 
	state( ref( applicationContext.state.ASSEMBLING_START ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );

	objectsBuilt = 
	state( ref( applicationContext.state.OBJECTS_BUILT ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
	
	domainListenersAssigned =
	state( ref( applicationContext.state.DOMAIN_LISTENERS_ASSIGNED ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
	
	methodsCalled =
	state( ref( applicationContext.state.METHODS_CALLED ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
	
	modulesInitialized =
	state( ref( applicationContext.state.MODULES_INITIALIZED ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
	
	assemblingEnd =
	state( ref( applicationContext.state.ASSEMBLING_END ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockStateCommand );
}
Example of extension of native states transitions
@context( 
			name = 'applicationContext', 
			type = hex.ioc.parser.xml.assembler.mock.MockApplicationContext )
{
	customState = state( ref( this.state.CUSTOM_STATE ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommandWithModule, contextOwner( anotherModule ) );

	anotherState = state( ref( this.state.ANOTHER_STATE ) )
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand, fireOnce );
	
	@map_type( 'hex.module.IModule' )
	module = new hex.ioc.parser.xml.assembler.mock.MockModule();
	
	@map_type( 'hex.module.IModule' )
	anotherModule = new hex.ioc.parser.xml.assembler.mock.MockModule();
}
Example of building custom states transitions
@context
{
	messageID = new hex.event.MessageType( 'messageName' );
	anotherMessageID = new hex.event.MessageType( 'anotherMessageName' );
	
	customState = state()
		.enter( method(module.callback) )
		.transition( messageID, anotherCustomState );
	
	anotherCustomState = state()
		.enter( hex.ioc.parser.xml.assembler.mock.MockStateCommand )
		.exit( hex.ioc.parser.xml.assembler.mock.MockExitStateCommand )
		.transition( anotherMessageID, customState );
		
	@map_type( 'hex.module.IModule' )
	module = new hex.ioc.parser.xml.assembler.mock.MockModule();
}

Enhancements

  • @optional argument is optional for IInjectorContainer [#237]
  • Haxe 4 nightly build support on JS, neko and Flash targets

Bugfixes

  • reference.property passed as a constructor argument of an instance of IDependencyOwner with flow prevents from compiling.