Skip to content

Commit 38e5d69

Browse files
refactor(overmind): rename IS_PIPE to IS_OPERATOR
1 parent 0e2b32d commit 38e5d69

File tree

1 file changed

+14
-14
lines changed
  • packages/node_modules/overmind/src

1 file changed

+14
-14
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export type OnInitialize = TOnInitialize<TheConfig>
4848
const isPlainObject = require('is-plain-object')
4949
const IS_PRODUCTION = process.env.NODE_ENV === 'production'
5050
const IS_DEVELOPMENT = process.env.NODE_ENV === 'development'
51-
const IS_PIPE = Symbol('pipe')
51+
const IS_OPERATOR = Symbol('operator')
5252

5353
export const log = (...objects: any[]) =>
5454
console.log(...objects.map((obj) => JSON.parse(JSON.stringify(obj))))
@@ -229,12 +229,12 @@ export class Overmind<Config extends Configuration> implements Configuration {
229229
private createAction(name, action) {
230230
this.actionReferences.push(action)
231231
return (value?) => {
232-
if (IS_PRODUCTION || action[IS_PIPE]) {
232+
if (IS_PRODUCTION || action[IS_OPERATOR]) {
233233
return new Promise((resolve, reject) => {
234234
const execution = this.createExecution(name, action)
235235
this.eventHub.emit(EventType.ACTION_START, execution)
236236

237-
action[IS_PIPE]
237+
action[IS_OPERATOR]
238238
? action(
239239
null,
240240
this.createContext(value, execution, this.proxyStateTree.get()),
@@ -572,7 +572,7 @@ export function pipe(...operators) {
572572
runNextOperator(null, context)
573573
}
574574
}
575-
instance[IS_PIPE] = true
575+
instance[IS_OPERATOR] = true
576576
return instance
577577
}
578578

@@ -660,7 +660,7 @@ export function map<Input, Output, Config extends Configuration = TheConfig>(
660660
next(null, newContext)
661661
}
662662
}
663-
instance[IS_PIPE] = true
663+
instance[IS_OPERATOR] = true
664664

665665
return instance
666666
}
@@ -683,7 +683,7 @@ export function run<Input, Config extends Configuration = TheConfig>(
683683
next(null, newContext)
684684
}
685685
}
686-
instance[IS_PIPE] = true
686+
instance[IS_OPERATOR] = true
687687

688688
return instance
689689
}
@@ -729,7 +729,7 @@ export function forEach<
729729
})
730730
}
731731
}
732-
instance[IS_PIPE] = true
732+
instance[IS_OPERATOR] = true
733733

734734
return instance
735735
}
@@ -771,7 +771,7 @@ export function parallel<Input, Config extends Configuration = TheConfig>(
771771
})
772772
}
773773
}
774-
instance[IS_PIPE] = true
774+
instance[IS_OPERATOR] = true
775775

776776
return instance
777777
}
@@ -794,7 +794,7 @@ export function filter<Input, Config extends Configuration = TheConfig>(
794794
}
795795
}
796796
}
797-
instance[IS_PIPE] = true
797+
instance[IS_OPERATOR] = true
798798

799799
return instance
800800
}
@@ -818,7 +818,7 @@ export function mutate<Input, Config extends Configuration = TheConfig>(
818818
next(null, newContext)
819819
}
820820
}
821-
instance[IS_PIPE] = true
821+
instance[IS_OPERATOR] = true
822822

823823
return instance
824824
}
@@ -851,7 +851,7 @@ export function fork<
851851
paths[path](null, newContext, nextWithPaths)
852852
}
853853
}
854-
instance[IS_PIPE] = true
854+
instance[IS_OPERATOR] = true
855855

856856
return instance
857857
}
@@ -893,7 +893,7 @@ export function when<
893893
}
894894
}
895895
}
896-
instance[IS_PIPE] = true
896+
instance[IS_OPERATOR] = true
897897

898898
return instance
899899
}
@@ -909,7 +909,7 @@ export function wait<Input, Config extends Configuration = TheConfig>(
909909
setTimeout(() => next(null, newContext), ms)
910910
}
911911
}
912-
instance[IS_PIPE] = true
912+
instance[IS_OPERATOR] = true
913913

914914
return instance
915915
}
@@ -936,7 +936,7 @@ export function debounce<Input, Config extends Configuration = TheConfig>(
936936
next(null, newContext)
937937
}, ms)
938938
}
939-
instance[IS_PIPE] = true
939+
instance[IS_OPERATOR] = true
940940

941941
return instance
942942
}

0 commit comments

Comments
 (0)