@@ -15,6 +15,13 @@ var SubmitRequest = require('./submit-request');
15
15
var warnDeprecatedDoc = true ;
16
16
var warnDeprecatedAfterSubmit = true ;
17
17
18
+ var DOC_ACTION_DEPRECATION_WARNING = 'DEPRECATED: "doc" middleware action. Use "readSnapshots" instead. ' +
19
+ 'Pass `disableDocAction: true` option to ShareDB to disable the "doc" action and this warning.' ;
20
+
21
+ var AFFTER_SUBMIT_ACTION_DEPRECATION_WARNING = 'DEPRECATED: "after submit" middleware action. ' +
22
+ 'Use "afterSubmit" instead. Pass `disableSpaceDelimitedActions: true` option to ShareDB to ' +
23
+ 'disable the "after submit" action and this warning.' ;
24
+
18
25
function Backend ( options ) {
19
26
if ( ! ( this instanceof Backend ) ) return new Backend ( options ) ;
20
27
emitter . EventEmitter . call ( this ) ;
@@ -94,10 +101,7 @@ Backend.prototype.SNAPSHOT_TYPES = {
94
101
Backend . prototype . _shimDocAction = function ( ) {
95
102
if ( warnDeprecatedDoc ) {
96
103
warnDeprecatedDoc = false ;
97
- console . warn ( [
98
- 'DEPRECATED: "doc" middleware action. Use "readSnapshots" instead.' ,
99
- 'Pass `disableDocAction: true` option to ShareDB to disable the "doc" action and this warning.'
100
- ] . join ( ' ' ) ) ;
104
+ console . warn ( DOC_ACTION_DEPRECATION_WARNING ) ;
101
105
}
102
106
103
107
var backend = this ;
@@ -114,10 +118,7 @@ Backend.prototype._shimDocAction = function() {
114
118
Backend . prototype . _shimAfterSubmit = function ( ) {
115
119
if ( warnDeprecatedAfterSubmit ) {
116
120
warnDeprecatedAfterSubmit = false ;
117
- console . warn ( [
118
- 'DEPRECATED: "after submit" middleware action. Use "afterSubmit" instead. Pass' ,
119
- '`disableSpaceDelimitedActions: true` option to ShareDB to disable the "after submit" action and this warning.'
120
- ] . join ( ' ' ) ) ;
121
+ console . warn ( AFFTER_SUBMIT_ACTION_DEPRECATION_WARNING ) ;
121
122
}
122
123
123
124
var backend = this ;
0 commit comments