df_di 0.16.1
df_di: ^0.16.1 copied to clipboard
A pragmatic dependency injection (DI) system, coupled with service classes for seamless state management in Dart.
Changelog #
0.16.1 #
- update
0.16.0 #
- breaking:
ServiceMixin.init/pause/resumereturnErron invalid lifecycle transitions (initafterdispose, secondinit,pause/resumebeforeinit) instead of silently resolving Ok. Idempotent calls (pause-when-paused, resume-when-resumed, dispose-when-disposed) still returnOk(None). - breaking: ECS events use subtype propagation —
readEvents<E>andWorld.onEvent<E>now match viaevent is E, so a derived event reaches base-typed readers. Previously buffers and listener maps were keyed by exact runtime type and base-typed readers saw nothing. - feat: ECS
despawn,clearEntities,removeResource, andWorld.disposecascadedispose()(fire-and-forget) to component / resource values that mixServiceMixin, so subscriptions and timers no longer leak past the world's lifetime. - feat: ECS
updateis re-entrant safe — a system callingworld.updaterecursively shares the outer tick's event buffer; only the outermost return drains it. - fix:
register<T>,until*, anduntilExactlyKreturn anErrResolvableinstead of throwing when a concurrent unregister wipes the slot between resolution and the post-resolution lookup. - fix:
registerAndInitServicenow fires the user-suppliedonUnregistercallback even when the service'sdispose()resolves toError the registered slot resolved toErr. - fix:
unregisterChild/unregisterChildTpropagate child-construction failure asErrin the returnedResultinstead of throwing. - fix:
DIRegistry.removeWherenow prunes empty groups and fires the change listener — previously it leaked ghost group keys and skipped change notifications. - fix:
children()andresolveAllsnapshot the registry so re-entrant register / unregister fired from anonRegister/onUnregistercallback no longer throwsConcurrentModificationError.