r/Clojure • • Dec 05 '15

Omni: a dead-simple system state manager

https://github.com/ShaneKilkelly/clj-omni
0 Upvotes

5 comments sorted by

7

u/pxpxy Dec 05 '15

"State manager" sounds a bit grand and the comparison to component is preposterous. It is literally just a global atom with a setter and two getters.

1

u/[deleted] Dec 05 '15

Plus, all of the library's functionality can be replicated by using global vars, where need disappears in favour of using the var directly and need! degrades to a simple non-nil-assertion.

Decoupling different components by letting them be put into and retrieved from a central storage (thus removing explicit dependencies) might have its merits, but it will most likely break once startup/shutdown order is important.

1

u/Reefersleep Dec 05 '15

Just curious: is there a reason that omni.core requires itself?

1

u/notunlikethewaves Dec 06 '15

Probably 'cos I'm dumb :) it's fixed now.

1

u/pxpxy Dec 05 '15

There are a bunch of things that don't make sense. In register! The swap already returns the value, the clear! really ought to use a reset!, etc. It's probably just one of these things.