1
0
mirror of https://github.com/flarum/core.git synced 2025-10-17 01:36:09 +02:00

Put m.stream in flarum/utils/stream (#2316)

This commit is contained in:
Alexander Skvortsov
2020-09-27 23:49:33 -04:00
committed by GitHub
parent 6860b24b70
commit cc875f3e95
16 changed files with 52 additions and 39 deletions

View File

@@ -12,6 +12,7 @@ import anchorScroll from './utils/anchorScroll';
import RequestError from './utils/RequestError';
import abbreviateNumber from './utils/abbreviateNumber';
import * as string from './utils/string';
import Stream from './utils/Stream';
import SubtreeRetainer from './utils/SubtreeRetainer';
import setRouteWithForcedRefresh from './utils/setRouteWithForcedRefresh';
import extract from './utils/extract';
@@ -85,6 +86,7 @@ export default {
'utils/extract': extract,
'utils/ScrollListener': ScrollListener,
'utils/stringToColor': stringToColor,
'utils/Stream': Stream,
'utils/subclassOf': subclassOf,
'utils/setRouteWithForcedRefresh': setRouteWithForcedRefresh,
'utils/patchMithril': patchMithril,

View File

@@ -0,0 +1,3 @@
import Stream from 'mithril/stream';
export default Stream;

View File

@@ -1,6 +1,6 @@
import Stream from 'mithril/stream';
import extract from './extract';
import withAttr from './withAttr';
import Stream from './Stream';
let deprecatedMPropWarned = false;
let deprecatedMWithAttrWarned = false;
@@ -68,15 +68,13 @@ export default function patchMithril(global) {
Object.keys(defaultMithril).forEach((key) => (modifiedMithril[key] = defaultMithril[key]));
modifiedMithril.stream = Stream;
modifiedMithril.route.Link = modifiedLink;
// BEGIN DEPRECATED MITHRIL 2 BC LAYER
modifiedMithril.prop = function (...args) {
modifiedMithril.prop = modifiedMithril.stream = function (...args) {
if (!deprecatedMPropWarned) {
deprecatedMPropWarned = true;
console.warn('m.prop() is deprecated, please use m.stream() instead.');
console.warn('m.prop() is deprecated, please use the Stream util (flarum/utils/Streams) instead.');
}
return Stream.bind(this)(...args);
};