123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- define("sedux/Sedux", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){"use strict";
- var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
- $core.addPackage('Sedux');
- $core.packages["Sedux"].innerEval = function (expr) { return eval(expr); };
- $core.packages["Sedux"].transport = {"type":"amd","amdNamespace":"sedux"};
- $core.addClass('SeduxCreatorClass', $globals.Object, [], 'Sedux');
- $core.addMethod(
- $core.method({
- selector: "<<",
- protocol: 'as yet unclassified',
- fn: function (aStoreEnhancer){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(aStoreEnhancer)._next_(self);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"<<",{aStoreEnhancer:aStoreEnhancer},$globals.SeduxCreatorClass.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStoreEnhancer"],
- source: "<< aStoreEnhancer\x0a\x09^ aStoreEnhancer next: self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["next:"]
- }),
- $globals.SeduxCreatorClass.klass);
- $core.addMethod(
- $core.method({
- selector: "inject:",
- protocol: 'as yet unclassified',
- fn: function (anObject){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return self._inject_into_(anObject,nil);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"inject:",{anObject:anObject},$globals.SeduxCreatorClass.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "inject: anObject\x0a\x09^ self inject: anObject into: nil",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["inject:into:"]
- }),
- $globals.SeduxCreatorClass.klass);
- $core.addClass('Sedux', $globals.SeduxCreatorClass, [], 'Sedux');
- $core.addMethod(
- $core.method({
- selector: "dispatch:with:fallback:",
- protocol: 'as yet unclassified',
- fn: function (anAction,aReceiver,aBlock){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv(aReceiver)._respondsTo_($recv(anAction)._selector());
- return $recv($1)._ifTrue_ifFalse_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $recv(anAction)._sendTo_(aReceiver);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }),aBlock);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"dispatch:with:fallback:",{anAction:anAction,aReceiver:aReceiver,aBlock:aBlock},$globals.Sedux.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anAction", "aReceiver", "aBlock"],
- source: "dispatch: anAction with: aReceiver fallback: aBlock\x0a\x09^ (aReceiver respondsTo: anAction selector)\x0a\x09\x09ifTrue: [ anAction sendTo: aReceiver ]\x0a\x09\x09ifFalse: aBlock",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["ifTrue:ifFalse:", "respondsTo:", "selector", "sendTo:"]
- }),
- $globals.Sedux.klass);
- $core.addMethod(
- $core.method({
- selector: "inject:into:",
- protocol: 'as yet unclassified',
- fn: function (aReducer,anObject){
- var self=this;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aReducer", "anObject"],
- source: "inject: aReducer into: anObject\x0a\x09\x22Creates a store, dispatches initiating message\x22",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.Sedux.klass);
- $core.addClass('SeduxDecorator', $globals.SeduxCreatorClass, ['next'], 'Sedux');
- $core.addMethod(
- $core.method({
- selector: "next:",
- protocol: 'accessing',
- fn: function (anObject){
- var self=this;
- self["@next"]=anObject;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anObject"],
- source: "next: anObject\x0a\x09next := anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.SeduxDecorator);
- $globals.SeduxDecorator.klass.iVarNames = ['next'];
- $core.addMethod(
- $core.method({
- selector: "inject:into:",
- protocol: 'as yet unclassified',
- fn: function (aReducer,anObject){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv($globals.SeduxDecoratedStore)._dispatch_next_(self._new(),self._nextInject_into_(aReducer,anObject));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"inject:into:",{aReducer:aReducer,anObject:anObject},$globals.SeduxDecorator.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aReducer", "anObject"],
- source: "inject: aReducer into: anObject\x0a\x09^ SeduxDecoratedStore dispatch: self new next: (self nextInject: aReducer into: anObject)",
- referencedClasses: ["SeduxDecoratedStore"],
- //>>excludeEnd("ide");
- messageSends: ["dispatch:next:", "new", "nextInject:into:"]
- }),
- $globals.SeduxDecorator.klass);
- $core.addMethod(
- $core.method({
- selector: "next:",
- protocol: 'as yet unclassified',
- fn: function (aStoreCreator){
- var self=this;
- self["@next"]=aStoreCreator;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aStoreCreator"],
- source: "next: aStoreCreator\x0a\x09next := aStoreCreator.\x0a\x09^self",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.SeduxDecorator.klass);
- $core.addMethod(
- $core.method({
- selector: "nextInject:into:",
- protocol: 'as yet unclassified',
- fn: function (aReducer,anObject){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- return $recv(self["@next"])._inject_into_(aReducer,anObject);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"nextInject:into:",{aReducer:aReducer,anObject:anObject},$globals.SeduxDecorator.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aReducer", "anObject"],
- source: "nextInject: aReducer into: anObject\x0a\x09^ next inject: aReducer into: anObject",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["inject:into:"]
- }),
- $globals.SeduxDecorator.klass);
- $core.addClass('SeduxFoo', $globals.SeduxDecorator, [], 'Sedux');
- $core.addClass('SeduxDecoratedStore', $globals.Object, ['next', 'dispatch'], 'Sedux');
- $core.addMethod(
- $core.method({
- selector: "dispatch:",
- protocol: 'accessing',
- fn: function (anAction){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $early={};
- try {
- return $recv($globals.Sedux)._dispatch_with_fallback_(anAction,self["@dispatch"],(function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- throw $early=[$recv(self["@next"])._dispatch_(anAction)];
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"dispatch:",{anAction:anAction},$globals.SeduxDecoratedStore)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anAction"],
- source: "dispatch: anAction\x0a\x09^ Sedux\x0a\x09\x09dispatch: anAction\x0a\x09\x09with: dispatch\x0a\x09\x09fallback: [ ^ next dispatch: anAction ]",
- referencedClasses: ["Sedux"],
- //>>excludeEnd("ide");
- messageSends: ["dispatch:with:fallback:", "dispatch:"]
- }),
- $globals.SeduxDecoratedStore);
- $core.addMethod(
- $core.method({
- selector: "dispatch:next:",
- protocol: 'accessing',
- fn: function (aDispatcher,aStore){
- var self=this;
- self["@dispatch"]=aDispatcher;
- self["@next"]=aStore;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aDispatcher", "aStore"],
- source: "dispatch: aDispatcher next: aStore\x0a\x09dispatch := aDispatcher.\x0a\x09next := aStore",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: []
- }),
- $globals.SeduxDecoratedStore);
- $core.addMethod(
- $core.method({
- selector: "dispatch:next:",
- protocol: 'instance creation',
- fn: function (aDispatcher,aStore){
- var self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=self._new();
- $recv($1)._dispatch_next_(aDispatcher,aStore);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"dispatch:next:",{aDispatcher:aDispatcher,aStore:aStore},$globals.SeduxDecoratedStore.klass)});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aDispatcher", "aStore"],
- source: "dispatch: aDispatcher next: aStore\x0a\x09^ self new\x0a\x09\x09dispatch: aDispatcher next: aStore;\x0a\x09\x09yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- messageSends: ["dispatch:next:", "new", "yourself"]
- }),
- $globals.SeduxDecoratedStore.klass);
- });
|