{"id":229,"date":"2015-12-20T17:06:37","date_gmt":"2015-12-20T08:06:37","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2015\/12\/20\/prepare-to-rxjs"},"modified":"2015-12-20T17:06:37","modified_gmt":"2015-12-20T08:06:37","slug":"prepare-to-rxjs","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2015\/12\/20\/prepare-to-rxjs\/","title":{"rendered":"Rx(JS)\u306b\u5165\u9580\u3059\u308b\u524d\u306b\u77e5\u3063\u3066\u304a\u304d\u305f\u3044N\u500b\u306e\u3053\u3068"},"content":{"rendered":"

\u30a2\u30c9\u30d9\u30f3\u30c8\u30ab\u30ec\u30f3\u30c0\u30fc\u30c9\u30ea\u30d6\u30f3\u30c0\u30a4\u30a8\u30c3\u30c8\u306b\u5931\u6557\u4e2d\u306e\u5c0f\u98fc\u3067\u3059\u3002
\n\u8d70\u3063\u3066\u3044\u308b\u306e\u306b\u4e2d\u3005\u75e9\u305b\u307e\u305b\u3093\u3002\u3069\u3046\u306a\u3063\u3066\u308b\u3093\u3060\u3002\u3002\u3002<\/p>\n

\u203b\u3053\u306e\u8a18\u4e8b\u306fRxJS Advent Calendar 2015<\/a>\u306e\u7b2c\u4e8c\u5341\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n

\u6982\u8981<\/h2>\n

\"\"<\/p>\n

\u6700\u8fd1\u30c1\u30e9\u30db\u30e9RxJS<\/code>\u306b\u3064\u3044\u3066\u306e\u8a18\u4e8b\u3092\u898b\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002
\n\u975e\u540c\u671f\u51e6\u7406\u3092\u7c21\u6f54\u306b\u66f8\u3051\u308b\u3053\u3068\u306b\u3064\u3044\u3066\u306e\u30dd\u30b8\u30c6\u30a3\u30d6\u306a\u30dd\u30b9\u30c8\u3092\u898b\u304b\u3051\u308b\u4e00\u65b9\u3067\u3001\u4e3b\u306b\u5b66\u7fd2\u30b3\u30b9\u30c8\u306e\u9762\u3067\u30cd\u30ac\u30c6\u30a3\u30d6\u306a\u610f\u898b\u304c\u76ee\u7acb\u3063\u3066\u3044\u308b\u3053\u3068\u3082\u5426\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n

\u79c1\u306f\u696d\u52d9\u3067\u30d0\u30ea\u30d0\u30eaRxJS<\/code>\u3092\u4f7f\u3044\u3053\u306a\u3057\u3066\u3044\u308b\uff01\u3068\u3044\u3046\u3088\u3046\u306a\u30ec\u30d9\u30eb\u3067\u306f\u5230\u5e95\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u5165\u9580\u30d6\u30ed\u30b0\u30fb\u66f8\u7c4d\u306a\u3069\u3092\u8aad\u3093\u3060\u308a\u7c21\u5358\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u307f\u3066\u3001\u4e8b\u524d\u306b\u3007\u3007\u306b\u3064\u3044\u3066\u77e5\u3063\u3066\u3044\u308b\u3068\u7406\u89e3\u304c\u65e9\u305d\u3046<\/code>\u3068\u601d\u3063\u305f\u70b9\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n

\u305d\u3053\u3067\u672c\u7a3f\u3067\u306fRx(JS)\u306b\u5165\u9580\u3059\u308b\u524d\u306b\u77e5\u3063\u3066\u304a\u304d\u305f\u3044N\u500b\u306e\u3053\u3068<\/code>\u3068\u984c\u3057\u3066\u3001\u4e8b\u524d\u306b\u77e5\u3063\u3066\u304a\u304f\u3068\u30b9\u30e0\u30fc\u30ba\u306bRxJS<\/code>\u306b\u5165\u9580\u51fa\u6765\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u306a\u3068\u601d\u3046\u3053\u3068\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n

\u3068\u8a00\u3063\u3066\u3082\u3054\u7d39\u4ecb\u3057\u305f\u3044\u306e\u306f\u57fa\u672c\u7684\u306a\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u306b\u3064\u3044\u3066\u306e\u4e8b\u306a\u306e\u3067\u3001\u65e2\u306b\u3054\u5b58\u77e5\u306e\u65b9\u3082\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002
\n\u305f\u3060\u3001\u305d\u3046\u3044\u3063\u305f\u65b9\u3067\u3082\u4e8b\u524d\u306b\u3053\u306e\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u306b\u5f37\u304f\u95a2\u9023\u304c\u3042\u308b\u306e\u3060<\/code>\u3068\u524d\u3082\u3063\u3066\u5fc3\u7a4d\u3082\u308a\u3092\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u30b9\u30e0\u30fc\u30ba\u306a\u7406\u89e3\u304c\u5f97\u3089\u308c\u308b\u304b\u3082\u77e5\u308c\u307e\u305b\u3093\u3002<\/p>\n

\u307e\u305f\u3001\u8aac\u660e\u3092\u7c21\u5358\u306b\u3059\u308b\u305f\u3081\u306b\u3001\u8af8\u3005\u3092\u5358\u7d14\u5316\u3057\u904e\u304e\u3066\u3044\u308b\u7b87\u6240\u304c\u3042\u308b\u304b\u3082\u77e5\u308c\u307e\u305b\u3093\u3002
\n\u305d\u3053\u306f\u3072\u3068\u3048\u306b\u79c1\u306e\u80fd\u529b\u4e0d\u8db3\u306b\u3088\u308b\u3068\u3053\u308d\u3067\u3059\u306e\u3067\u3001\u30ac\u30c1\u306a\u65b9\u3005\u306b\u306f\u305d\u3053\u3089\u8fba\u3092\u3054\u5bb9\u8d66\u304a\u9858\u3044\u3057\u307e\u3059 :bow:<\/p>\n

\u524d\u63d0: \u975e\u540c\u671f\u51e6\u7406\u306f\u96e3\u3057\u3044<\/h2>\n

JavaScript<\/code>\u306b\u3088\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001\u975e\u540c\u671f\u51e6\u7406\u3068\u3044\u3046\u306e\u306f\u907f\u3051\u3066\u901a\u308c\u307e\u305b\u3093\u3002
\n\u3053\u308c\u306f\u3001\u3044\u3064\u767a\u751f\u3059\u308b\u304b\u308f\u304b\u3089\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u5165\u529b\u3092event loop<\/code>\u3067\u634c\u3044\u3066\u3044\u304fJavaScript<\/code>\u306e\u8a00\u8a9e\u8a2d\u8a08\u306e\u5bbf\u547d\u3068\u8a00\u3048\u307e\u3059\u3002<\/p>\n

\u3053\u306e\u975e\u540c\u671f\u51e6\u7406\u306e\u64cd\u4f5c\u3068\u3044\u3046\u306e\u306f\u4e00\u822c\u306b\u308f\u304b\u308a\u3065\u3089\u3044\u3082\u306e\u306b\u306a\u308a\u304c\u3061\u3067\u3059\u3002
\n\u3044\u3064\u5b8c\u4e86\u3059\u308b\u306e\u304b\u304c\u4e88\u3081\u5206\u304b\u308a\u307e\u305b\u3093\u3057\u3001\u8907\u6570\u306e\u975e\u540c\u671f\u51e6\u7406\u304c\u3042\u308b\u5834\u5408\u306b\u3082\u5b8c\u4e86\u9806\u5e8f\u306f\u4fdd\u8a3c\u3055\u308c\u307e\u305b\u3093\u3002
\n\u307e\u305f\u3001\u5b9f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u4e0a\u3067\u306f\u3057\u3070\u3057\u3070\u5b8c\u4e86\u3057\u306a\u3044\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n

\u975e\u540c\u671f\u51e6\u7406\u3063\u3066\u3069\u3046\u3044\u3046\u3053\u3068\uff1fJavaScript\u3067\u4e00\u304b\u3089\u5b66\u3076<\/a><\/p>\n

\u305d\u3053\u3067JavaScript<\/code>\u754c\u9688\u3067\u306f\u3001\u3053\u306e\u975e\u540c\u671f\u51e6\u7406\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u8a18\u8ff0\u3059\u308b\u305f\u3081\u306e\u69d8\u3005\u306a\u6280\u6cd5\u304c\u53d6\u308a\u5165\u308c\u3089\u308c\u3066\u304d\u307e\u3057\u305f\u3002
\n\u4f8b\u3048\u3070Promise<\/code>\u3084Generator<\/code>\u3092\u4f7f\u3063\u305f\u540c\u671f\u51e6\u7406\u98a8\u306a\u8a18\u8ff0\u65b9\u6cd5\u306a\u3069\u3067\u3059\u3002<\/p>\n

\u305f\u3060\u3001\u5b9f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3057\u3070\u3057\u3070\u8907\u96d1\u306a\u975e\u540c\u671f\u51e6\u7406\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u306b\u8feb\u3089\u308c\u307e\u3059\u3002<\/p>\n

\u4f8b\u3048\u3070\u30e6\u30fc\u30b6\u30fc\u306e\u30ad\u30fc\u30dc\u30fc\u30c9\u5165\u529b\u306b\u7279\u5b9a\u306e\u6587\u5b57\u5217\u3092\u691c\u77e5\u3057\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30b5\u30fc\u30d0\u30fc\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u884c\u3057\u305f\u304b\u3063\u305f\u308a(rx<\/code>, cycle<\/code>\u306a\u3069\u306enpm<\/code>\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u5b58\u5728\u3059\u308b\u5358\u8a9e\u304c\u5165\u529b\u3055\u308c\u305f\u3089\u3001\u8a72\u5f53\u3057\u305d\u3046\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u60c5\u5831\u3092\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u53d6\u3063\u3066\u304f\u308b\u3001\u307f\u305f\u3044\u306a)\u3001\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u8907\u6570\u56de\u884c\u3063\u3066\u307f\u305f\u5185\u306e\u7279\u5b9a\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u3092\u4f7f\u7528\u3057\u305f\u3044(\u30b8\u30e7\u30fc\u30afAPI\u306b?random=true<\/code>\u306e\u3088\u3046\u306a\u30af\u30a8\u30ea\u4ed8\u304d\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6295\u3052\u305f\u6642\u306b\u3001Chuck Norris<\/code>\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u542b\u307e\u306a\u3044\u30ec\u30b9\u30dd\u30f3\u30b9\u3060\u3051\u3092\u63a1\u7528\u3057\u305f\u3044)\u3068\u3044\u3046\u3088\u3046\u306a\u30b1\u30fc\u30b9\u3067\u3059\u3002<\/p>\n

\u3082\u3061\u308d\u3093Promise<\/code>\u3084Generator<\/code>\u306e\u3088\u3046\u306a\u6163\u308c\u89aa\u3057\u3093\u3060\u6982\u5ff5\u3067\u3082\u5145\u5206\u306b\u5b9f\u88c5\u53ef\u80fd\u3067\u3059\u304c\u3001\u5f80\u3005\u306b\u3057\u3066\u4e0d\u5b89\u5b9a\u3067\u8907\u96d1\u306a\u5b9f\u88c5\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u304c\u3061\u3067\u3059\u3002
\n\u305d\u3093\u306a\u975e\u540c\u671f\u51e6\u7406\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u3001\u3082\u3063\u3068\u30b7\u30f3\u30d7\u30eb\u3067\u5b89\u5b9a\u3057\u305f\u5b9f\u88c5\u306b\u3059\u308b\u305f\u3081\u306e\u30a2\u30a4\u30c7\u30a3\u30a2\u304cReactive Extensions(ReactiveX\u307e\u305f\u306fRx)<\/code>\u3067\u3059<\/p>\n

Reactive Extensions\u3068\u306f?<\/h2>\n

\u516c\u5f0f\u30b5\u30a4\u30c8<\/a>\u306e\u30c8\u30c3\u30d7\u306b\u306f\u3001<\/p>\n

\n

An API for asynchronous programming with observable streams<\/p>\n<\/blockquote>\n

\u30aa\u30d6\u30b6\u30fc\u30d0\u30d6\u30eb\u30b9\u30c8\u30ea\u30fc\u30e0\u306b\u3088\u308b\u3001\u975e\u540c\u671f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u305f\u3081\u306eAPI<\/code>\u3068\u3042\u308a\u307e\u3059\u3002
\n\u3053\u308c\u3060\u3051\u3067\u306f\u3088\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u3002\u3002\u3002
\n\u66f4\u306b\u4e0b\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3059\u308b\u3068\u3001<\/p>\n

\n

ReactiveX is a combination of the best ideas from the Observer pattern, the Iterator pattern, and functional programming<\/p>\n<\/blockquote>\n

ReactiveX\u306f\u30aa\u30d6\u30b6\u30fc\u30d0\u30d1\u30bf\u30fc\u30f3\u3068\u30a4\u30c6\u30ec\u30fc\u30bf\u30d1\u30bf\u30fc\u30f3\u3001\u305d\u308c\u304b\u3089\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u826f\u3044\u30a2\u30a4\u30c7\u30a3\u30a2\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u3082\u306e\u3067\u3059<\/code>\u3068\u3042\u308a\u307e\u3059\u3002<\/p>\n

\u30aa\u30d6\u30b6\u30fc\u30d0\u30d1\u30bf\u30fc\u30f3\u3068\u30a4\u30c6\u30ec\u30fc\u30bf\u30d1\u30bf\u30fc\u30f3(\u3053\u308c\u3092\u6307\u3057\u3066\u30aa\u30d6\u30b6\u30fc\u30d0\u30d6\u30eb\u30b9\u30c8\u30ea\u30fc\u30e0\u3068\u547c\u3093\u3067\u3044\u308b\u3088\u3046\u3067\u3059)\u306b\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u30a8\u30c3\u30bb\u30f3\u30b9\u304c\u7d44\u307f\u5408\u308f\u3055\u308b\u3068\u3001
\n\u306a\u305c\u975e\u540c\u671f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a18\u8ff0\u304c\u7c21\u5358\u306b\u306a\u308b\u306e\u3067\u3057\u3087\u3046\u304b\uff1f
\n\u305d\u3053\u3092\u7d0d\u5f97\u3067\u304d\u308c\u3070\u3001\u96e3\u3057\u305d\u3046\u306aRx<\/code>\u306b\u5165\u9580\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u304c\u898b\u3048\u3066\u304d\u305d\u3046\u306b\u601d\u3044\u307e\u3059\u3002<\/p>\n


\n

Rx<\/code>\u306b\u5165\u9580\u3059\u308b\u524d\u306b\u30fb\u305d\u306e1: \u53cd\u5fa9\u3059\u308b\u8981\u7d20\u306e\u64cd\u4f5c\u306f\u7c21\u5358<\/h3>\n

\u4f8b\u3048\u3070\u914d\u5217\u306e\u64cd\u4f5c\u3068\u3044\u3046\u306e\u306f\u666e\u6bb5\u304b\u3089\u3088\u304f\u8a18\u8ff0\u3057\u3066\u3044\u3066\u3001\u7279\u306b\u5f15\u3063\u639b\u304b\u308b\u3068\u3053\u308d\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

\u914d\u5217\u306e\u5185\u5bb9\u3092\u4e00\u90e8\u5909\u63db\u3057\u305f\u308a\u3001<\/p>\n

['I', 'like', 'meat.'].map((str)=> str === 'meat' ? 'vegetable.' : str)\n\/\/ ['i', 'like', 'vegetable.']<\/code><\/pre>\n

\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3057\u305f\u308a\u3059\u308b\u3088\u3046\u306a\u64cd\u4f5c\u306f\u65e5\u5e38\u7684\u306b\u884c\u3063\u3066\u3044\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n

['I', 'like', 'meat.'].filter((str)=> str.match(\/.\/))\n\/\/ ['meat.']<\/code><\/pre>\n

\u64cd\u4f5c\u5bfe\u8c61\u306e\u30c7\u30fc\u30bf\u304c\u914d\u5217\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u306a\u304f\u3068\u3082\u3001\u30a4\u30c6\u30ec\u30fc\u30bf\u30d1\u30bf\u30fc\u30f3\u3092\u7528\u3044\u3066\u4efb\u610f\u306e\u30c7\u30fc\u30bf\u3092\u53cd\u5fa9\u51e6\u7406\u3057\u3084\u3059\u3044\u5f62\u306b\u5909\u63db\u3057\u3066\u3042\u3052\u308c\u3070\u3001\u540c\u3058\u3088\u3046\u306b\u7c21\u5358\u306a\u64cd\u4f5c\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n

const iterable = {\n  someData: [ 'I', 'like', 'meat' ],\n  hasNext() {\n    return this.someData.length > 0;\n  },\n  next() {\n    this.someData.shift();\n  }\n}\n\nwhile(iterable.hasNext()) {\n  console.log(iterable.someData);\n  iterable.next();\n}\n\/*\n[ 'I', 'like', 'meat' ]\n[ 'like', 'meat' ]\n[ 'meat' ]\n*\/<\/code><\/pre>\n

Rx<\/code>\u306b\u5165\u9580\u3059\u308b\u524d\u306b\u30fb\u305d\u306e2: \u975e\u540c\u671f\u51e6\u7406\u306e\u76e3\u8996\u306f\u7c21\u5358<\/h3>\n

\u7279\u306bJavaScript<\/code>\u754c\u9688\u3067\u306f\u30aa\u30d6\u30b6\u30fc\u30d0\u30d1\u30bf\u30fc\u30f3\u306b\u3088\u308b\u5b9f\u88c5\u306f\u81f3\u308b\u6240\u306b\u3042\u308a\u3001\u4f8b\u3048\u3070\u30d6\u30e9\u30a6\u30b6\u306b\u304a\u3051\u308b\u30af\u30ea\u30c3\u30af\u30a4\u30d9\u30f3\u30c8\u306e\u76e3\u8996\u306a\u3069\u306f\u983b\u7e41\u306b\u884c\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u306e\u3067\u3001\u3053\u3061\u3089\u3082\u5bb9\u6613\u306b\u64cd\u4f5c\u51fa\u6765\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

window.addEventListener('click', function(ev) {\n  console.log(ev);\n  \/\/ MouseEvent {isTrusted: true ...}\n})<\/code><\/pre>\n

Rx<\/code>\u306b\u5165\u9580\u3059\u308b\u524d\u306b\u30fb\u305d\u306e3: \u975e\u540c\u671f\u306a\u30a4\u30d9\u30f3\u30c8\u3092\u53cd\u5fa9\u3059\u308b\u8981\u7d20\u3068\u6349\u3048\u308b<\/h3>\n

\u3082\u3057\u30a4\u30c6\u30ec\u30fc\u30bf\u30d1\u30bf\u30fc\u30f3\u3068\u30aa\u30d6\u30b6\u30fc\u30d0\u30d1\u30bf\u30fc\u30f3\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u975e\u540c\u671f\u306a\u30a4\u30d9\u30f3\u30c8\u3092\u53cd\u5fa9\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306a\u4f55\u304b<\/code>\u306b\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308c\u3070\u3001\u975e\u540c\u671f\u306a\u30a4\u30d9\u30f3\u30c8\u3092\u8907\u96d1\u306b\u7d44\u307f\u5408\u308f\u305b\u305f\u308a\u5909\u63db\u3057\u305f\u308a\u3057\u3066\u3082\u3001\u7406\u89e3\u306e\u3057\u3084\u3059\u3055\u3092\u4fdd\u3063\u305f\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u304b\u3082\u77e5\u308c\u307e\u305b\u3093\u3002<\/p>\n

\u5225\u306e\u8a00\u3044\u65b9\u3092\u3059\u308b\u3068\u3001\u975e\u540c\u671f\u306a\u30a4\u30d9\u30f3\u30c8\u3092\u6642\u9593\u8ef8\u306b\u6cbf\u3063\u305f\u30a4\u30d9\u30f3\u30c8\u306e\u914d\u5217\u306e\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u6349\u3048\u308b\u3053\u3068\u3067\u3001\u7406\u89e3\u306e\u3057\u3084\u3059\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u3051\u308b\u304b\u3082\u77e5\u308c\u306a\u3044\u3001\u3068\u3044\u3046\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n

\u3053\u3046\u3044\u3063\u305f\u3001\u914d\u5217\u306e\u3088\u3046\u306b\u64cd\u4f5c\u3067\u304d\u308b\u76e3\u8996\u53ef\u80fd\u306a\u975e\u540c\u671f\u30a4\u30d9\u30f3\u30c8\u306e\u96c6\u5408\u3092\u6307\u3057\u3066\u3001Rx<\/code>\u3067\u306fObservable Stream<\/code>\u3068\u547c\u3093\u3067\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n

\u500b\u4eba\u7684\u306a\u89e3\u91c8\u3067\u3059\u304c\u3001\u3053\u3053\u3067\u8aac\u660e\u3057\u305fObservable Stream<\/code>\u306fNode.js<\/code>\u3067\u51fa\u3066\u304f\u308bStream<\/code>\u3068\u540c\u3058\u3082\u306e\u3068\u3057\u3066\u6349\u3048\u3066\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002
\n\u305f\u3060\u3057Rx<\/code>\u306b\u306fObservable Stream \u2252 Stream<\/code>\u3092\u914d\u5217\u3063\u307d\u304f\u4fbf\u5229\u306b\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u5927\u91cf\u306eAPI<\/code>\u7fa4\u304c\u4ed8\u968f\u3057\u3066\u3044\u308b\u3068\u3044\u3046\u9055\u3044\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n

Stream<\/code>\u3068\u3044\u3046\u3001\u30d6\u30e9\u30a6\u30b6JavaScript<\/code>\u754c\u9688\u3067\u306f\u307e\u3060\u99b4\u67d3\u307f\u306e\u8584\u3044\u3088\u3046\u306b\u601d\u308f\u308c\u308b\u6982\u5ff5\u306e\u7406\u89e3\u3068\u3001\u305d\u306eStream<\/code>\u3092\u64cd\u4f5c\u3059\u308bAPI\u7fa4<\/code>\u3078\u306e\u7406\u89e3\u3092\u6df7\u540c\u3057\u306a\u3044\u3053\u3068\u304c\u3001Rx<\/code>\u306b\u5165\u9580\u3059\u308b\u969b\u306b\u5927\u4e8b\u306b\u306a\u3063\u3066\u304f\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n\n\n\n\n
<\/th>\nRx(Observable Stream)<\/code><\/th>\nNode.js(Stream)<\/code><\/th>\n<\/tr>\n<\/thead>\n
Stream\u3078\u306e\u5909\u63db<\/td>\n\u25ef<\/td>\n\u25ef<\/td>\n<\/tr>\n
Stream\u306e\u89b3\u6e2c<\/td>\n\u25ef<\/td>\n\u25ef<\/td>\n<\/tr>\n
underscore\/lodash<\/code>\u7684\u306a\u4fbf\u5229\u306aAPI\u7fa4<\/td>\n\u25ef<\/td>\nx<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u203b\u3053\u306e\u8aac\u660e\u3067\u306f\u95a2\u6570\u578b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/code>\u306e\u90e8\u5206\u306b\u3064\u3044\u3066\u89e6\u308c\u3066\u3044\u307e\u305b\u3093\u304c\u3001Rx\u3078\u306e\u5165\u9580\u306e\u6e96\u5099<\/code>\u3068\u3044\u3046\u76ee\u7684\u3092\u3084\u3084\u3053\u3057\u304f\u3057\u3066\u3057\u307e\u3046\u3068\u601d\u3063\u305f\u306e\u3067\u7701\u3044\u3066\u3044\u307e\u3059\u3002
\n(\u79c1\u306fObservable Stream<\/code>\u3092\u5916\u90e8\u72b6\u614b\u306b\u4f9d\u5b58\u3057\u306a\u3044\u66f8\u304d\u65b9\u3067\u4f7f\u3046\u3053\u3068\u3067\u5b89\u5b9a\u3057\u3066\u7dba\u9e97\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3051\u308b\u3001\u307f\u305f\u3044\u306a\u7406\u89e3\u306e\u4ed5\u65b9\u3092\u3057\u3066\u3044\u307e\u3059)<\/p>\n

\u5b9f\u88c5\u4f8b<\/h2>\n

\u9577\u3005\u3068\u500b\u4eba\u7684\u306a\u89e3\u91c8\u3092\u66f8\u304d\u9023\u306d\u3066\u304d\u305f\u306e\u3067\u3001\u3053\u306e\u8fba\u3067\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u306b\u843d\u3068\u3057\u8fbc\u3093\u3067\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002
\n\u3053\u3053\u3067\u306f\u30de\u30fc\u30af\u30c0\u30a6\u30f3\u30a8\u30c7\u30a3\u30bf\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u60f3\u5b9a\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30ad\u30fc\u30dc\u30fc\u30c9\u5165\u529b\u30a4\u30d9\u30f3\u30c8\u304b\u3089\u3001`(\u9006\u30af\u30a9\u30fc\u30c8\u8a18\u53f7)\u3067\u56f2\u307e\u308c\u305f\u6587\u5b57\u5217\u3092
\nspan<\/code>\u30bf\u30b0\u3067\u56f2\u3093\u3060html\u6587\u5b57\u5217<\/code>\u306b\u5909\u63db\u3059\u308b\u3088\u3046\u306a\u51e6\u7406\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002
\n\u305f\u3060\u3057\u3001\u5909\u63db\u3057\u305fhtml\u6587\u5b57\u5217<\/code>\u3092\u305d\u306e\u5ea6\u306b\u63cf\u753b\u3057\u3066\u3044\u308b\u3068\u63cf\u753b\u30b3\u30b9\u30c8\u304c\u639b\u304b\u308a\u904e\u304e\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u60f3\u5b9a\u3067\u3001
\n500ms<\/code>\u6bce\u306b\u6700\u65b0\u306ehtml\u6587\u5b57\u5217<\/code>\u3092\u691c\u51fa\u3057\u305f\u3044\u3068\u3044\u3046\u4ed5\u69d8\u304c\u3042\u308b\u3068\u3057\u307e\u3057\u305f\u3002<\/p>\n

\u6e96\u5099<\/h3>\n

\u307e\u305a\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30ad\u30fc\u30dc\u30fc\u30c9\u5165\u529b\u3092\u6a21\u3057\u305finput<\/code>\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u884c\u3059\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n

\/\/ event-mock.js\nconst EventEmitter = require('events').EventEmitter;\nconst eventListener = new EventEmitter();\n\nconst texts = '\u30e6\u30fc\u30b6\u30fc\u304c\u6253\u3061\u8fbc\u3093\u3060\u30de\u30fc\u30af\u30c0\u30a6\u30f3\u3002\n\u9014\u4e2d\u306e`syntax-highlight`\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3055\u308c\u305f\u7b87\u6240\u306b\u3001\n\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30cf\u30a4\u30e9\u30a4\u30c8\u3092`\u5b9f\u88c5`\u3059\u308b\n';\n\nfunction userInputMock(str) {\n  if (str.length === 0) {\n    return;\n  }\n\n  \/\/ \u30e6\u30fc\u30b6\u30fc\u304c`interval`\u5909\u6570\u306e\u9593\u9694\u3067\u30ad\u30fc\u5165\u529b\u3092\u3057\u3066\u3044\u308b\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u3059\n  const interval = Math.random() * 50;\n  setTimeout(()=> {\n    eventListener.emit('input', str[0]);\n    userInputMock(str.substr(1));\n  }, interval);\n}\n\nuserInputMock(texts);\nmodule.exports = eventListener;<\/code><\/pre>\n

\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u306b\u3088\u308b\u5b9f\u88c5<\/h3>\n

\u3053\u308c\u3092\u5f93\u6765\u306e\u30aa\u30d6\u30b6\u30fc\u30d0\u30d1\u30bf\u30fc\u30f3\u306b\u3088\u308b\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3067\u5358\u7d14\u306b\u5b9f\u88c5\u3057\u3066\u307f\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3057\u305f\u3002
\n(\u4f8b\u3048\u3070Flux<\/code>\u306eActionCreators<\/code>\u5c64\u306b\u5b9f\u88c5\u3057\u305f\u3068\u8aad\u307f\u4ee3\u3048\u3066\u9802\u304f\u3053\u3068\u3082\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059)<\/p>\n

const eventListener = require('.\/input-event');\n\nvar resultStr = '';\nvar appearedCount = 0;\nvar isEnd = false;\n\neventListener.on('input', (str)=> {\n  if (resultStr.length === 0){\n    resultStr += `<p>${str}`;\n  } else if (str === '\n') {\n    isEnd = true;\n    resultStr += `<\/p>`;\n  } else if (str === '`') {\n    appearedCount++;\n    if (appearedCount % 2 !== 0) {\n      resultStr += `<span>`;\n    } else {\n      resultStr += `<\/span>`;\n    }\n  } else {\n    resultStr += str;\n  }\n});\n\nvar interval = setInterval(()=> {\n  console.log(resultStr);\n  \/\/ <p>\u30e6\u30fc\u30b6\u30fc\u304c\u6253\u3061\u8fbc\u3093\u3060\u30de\u30fc\u30af\u30c0\u30a6\u30f3\u3002\u9014\u4e2d\u306e<span>syntax-highlight<\/span>\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3055\u308c\u305f\u7b87\u6240\u306b\u3001\n  \/\/ \u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30cf\u30a4\u30e9\u30a4\u30c8\u3092<span>\u5b9f\u88c5<\/span>\u3059\u308b<\/p>\n  if (isEnd) {\n    clearInterval(interval);\n  }\n}, 500);<\/code><\/pre>\n

resultStr<\/code>\u3084appearedCount<\/code>\u306a\u3069\u3001\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u306e\u5916\u90e8\u30b9\u30b3\u30fc\u30d7\u306b\u5b58\u5728\u3059\u308b\u5909\u6570\u3092\u4f7f\u3063\u305f\u5b9f\u88c5\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u3061\u3087\u3063\u3068\u4e0d\u5b89\u306a\u6c17\u6301\u3061\u3067\u3059\u3002
\nif<\/code>\u6587\u306e\u30cd\u30b9\u30c8\u304c\u6df1\u3044\u306e\u3082\u3001\u3084\u3084\u6c17\u306b\u5165\u308a\u307e\u305b\u3093\u3002\u5c11\u306a\u304f\u3068\u3082\u8aad\u307f\u3084\u3059\u3044\u30b3\u30fc\u30c9\u306b\u306f\u51fa\u6765\u3066\u3044\u3044\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002
\n(\u3082\u3061\u308d\u3093\u3001\u3082\u3063\u3068\u5206\u304b\u308a\u3084\u3059\u3044\u30b3\u30fc\u30c9\u306b\u3059\u308b\u305f\u3081\u306e\u5de5\u592b\u306e\u4f59\u5730\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u8aac\u660e\u3092\u5358\u7d14\u306b\u3059\u308b\u305f\u3081\u306b\u308f\u3056\u3068\u77ed\u7d61\u7684\u306b\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059)<\/p>\n

\u914d\u5217\u306b\u5bfe\u3059\u308b\u5b9f\u88c5<\/h3>\n

Rx<\/code>\u3092\u4f7f\u3048\u3070\u3001\u975e\u540c\u671f\u30a4\u30d9\u30f3\u30c8\u3092\u914d\u5217\u306e\u3088\u3046\u306b\u51e6\u7406\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u306e\u3067\u3001\u4e8b\u524d\u6e96\u5099\u3068\u3057\u3066\u5358\u306a\u308b\u914d\u5217\u306b\u5bfe\u3057\u3066\u540c\u69d8\u306e\u51e6\u7406\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n

\/\/ \u30e6\u30fc\u30b6\u30fc\u306e\u5165\u529b\u30a4\u30d9\u30f3\u30c8\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6587\u5b57\u306e\u914d\u5217\u3067\u3042\u308b\u3068\u4eee\u5b9a\u3057\u307e\u3059\nconst inputs = [\n  '\u30e6', '\u30fc', '\u30b6', '\u30fc', '\u304c', '\u6253', '\u3061', '\u8fbc', '\u3093', '\u3060', '\u30de', '\u30fc', '\u30af', '\u30c0', '\u30a6', '\u30f3', '\u3002',\n  '\u9014', '\u4e2d', '\u306e', '`', 's', 'y', 'n', 't', 'a', 'x', '-', 'h', 'i', 'g', 'h', 'l', 'i', 'g', 'h', 't', '`',\n  '\u306e', '\u3088', '\u3046', '\u306b', '\u8a18', '\u8ff0', '\u3055', '\u308c', '\u305f', '\u7b87', '\u6240', '\u306b', '\u3001',\n  '\u30b7', '\u30f3', '\u30bf', '\u30c3', '\u30af', '\u30b9', '\u30cf', '\u30a4', '\u30e9', '\u30a4', '\u30c8', '\u3092', '`', '\u5b9f', '\u88c5', '`', '\u3059', '\u308b', '\n'\n];\n\n\/\/ \u51e6\u7406\u3057\u305f\u3044\u5185\u5bb9\u306b\u4f75\u305b\u3066\u3001`inputs`\u914d\u5217\u3092\u30d5\u30a3\u30eb\u30bf\u3059\u308b\u305f\u3081\u306e\u6761\u4ef6\u3092\u751f\u6210\u3059\u308b\u95a2\u6570(Predicate\u95a2\u6570)\u3092\u4f5c\u3063\u3066\u304a\u304d\u307e\u3059\u3002\n\/\/ \u4e00\u6587\u5b57\u76ee\u3084\u6700\u5f8c\u306e\u6539\u884c\u3001`(\u9006\u30af\u30a9\u30fc\u30c8\u8a18\u53f7)\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3057\u305f\u308a\u3001\u305d\u306e\u9006\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3057\u305f\u308a\u3067\u304d\u308b\u95a2\u6570\u3092\u751f\u6210\u3057\u307e\u3059\u3002\nvar filterFirst = (isFirst)=> isFirst ? (str, i)=> i === 0 : (str, i)=> i !== 0;\nvar filterLast = (isLast)=> isLast ? (str)=> str === '\n' : (str)=> str !== '\n';\nvar filterSign = (isSign)=> isSign ? (str)=> str === '`' : (str)=> str !== '`';\n\n\/\/ \u4e0a\u306e\uff13\u3064\u306e\u95a2\u6570\u304b\u3089\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066`inputs`\u914d\u5217\u3092\u5909\u63db\u3057\u307e\u3059\nconst first = inputs.filter(filterFirst(true)).map((val)=> `<p>${val}`);\nconst last = inputs.filter(filterLast(true)).map(()=> '<\/p>');\nconst sign = inputs.filter(filterSign(true)).map((val, i)=> i % 2 === 0 ? '<span>' : '<\/span>');\nconsole.log(first); \/\/ ['<p>\u30e6']\nconsole.log(last); \/\/ [ '<\/p>' ]\nconsole.log(sign); \/\/ [ '<span>', '<\/span>', '<span>', '<\/span>' ]\n\n\/\/ \u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3055\u308c\u306a\u304b\u3063\u305f\u6b8b\u308a\u306e\u6587\u5b57\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002\nconst strings = inputs\n  .filter(filterFirst(false))\n  .filter(filterLast(false))\n  .filter(filterSign(false));\n\nconsole.log(strings);\n\/*\n[\n  '\u30fc', '\u30b6', '\u30fc', '\u304c', '\u6253', '\u3061', '\u8fbc', '\u3093', '\u3060', '\u30de', '\u30fc', '\u30af', '\u30c0', '\u30a6', '\u30f3', '\u3002',\n  '\u9014', '\u4e2d', '\u306e', 's', 'y', 'n', 't', 'a', 'x', '-', 'h', 'i', 'g', 'h', 'l', 'i', 'g', 'h', 't',\n  '\u306e', '\u3088', '\u3046', '\u306b', '\u8a18', '\u8ff0', '\u3055', '\u308c', '\u305f', '\u7b87', '\u6240', '\u306b', '\u3001',\n  '\u30b7', '\u30f3', '\u30bf', '\u30c3', '\u30af', '\u30b9', '\u30cf', '\u30a4', '\u30e9', '\u30a4', '\u30c8', '\u3092', '\u5b9f', '\u88c5', '\u3059', '\u308b'\n]\n*\/<\/code><\/pre>\n

\u914d\u5217\u306e\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u306e\u969b\u306b\u3001\u5927\u672c\u306einputs<\/code>\u914d\u5217\u306b\u304a\u3051\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u5931\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u51fa\u6765\u4e0a\u304c\u3063\u305f\u914d\u5217\u9054\u3092\u6b63\u3057\u304f\u5408\u6210\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u304c\u3001\u8003\u3048\u65b9\u3068\u3057\u3066\u306f\u3053\u3046\u3044\u3046\u611f\u3058\u306b\u306a\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002(\u3061\u3083\u3093\u3068\u5b9f\u88c5\u3059\u308b\u306a\u3089inputs<\/code>\u914d\u5217\u3092{ char: '\u5b57', index: 0 }\u306e\u3088\u3046\u306a\u8981\u7d20\u306e\u914d\u5217\u306b\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u305d\u3046\u3067\u3059)<\/p>\n

Rx\u306b\u3088\u308b\u5b9f\u88c5<\/h3>\n

\u4e0a\u8ff0\u306e\u914d\u5217\u306b\u5bfe\u3059\u308b\u5b9f\u88c5\u3092\u53c2\u8003\u306b\u3001Rx<\/code>\u3092\u7528\u3044\u305fObservable Stream<\/code>\u306b\u5bfe\u3059\u308b\u5b9f\u88c5\u306b\u5909\u63db\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n

const Rx = require('rx');\nconst eventListener = require('.\/input-event');\n\nconst input$ = Rx.Observable.fromEvent(eventListener, 'input');\n\n\/\/ \u30d5\u30a3\u30eb\u30bf\u7528\u306ePredicate\u95a2\u6570\u3092\u8fd4\u3059\nvar filterFirst = (isFirst)=> isFirst ? (str, i)=> i === 0 : (str, i)=> i !== 0;\nvar filterLast = (isLast)=> isLast ? (str)=> str === '\n' : (str)=> str !== '\n';\nvar filterSign = (isSign)=> isSign ? (str)=> str === '`' : (str)=> str !== '`';\n\nconst first$ = input$.filter(filterFirst(true)).map((val)=> `<p>${val}`);\nconst last$ = input$.filter(filterLast(true)).map(()=> '<\/p>');\nconst sign$ = input$.filter(filterSign(true)).map((val, i)=> i % 2 === 0 ? '<span>' : '<\/span>');\n\nconst strings$ = input$\n  .filter(filterFirst(false))\n  .filter(filterLast(false))\n  .filter(filterSign(false));\n\n\/\/ \u6642\u9593\u8ef8\u306b\u5bfe\u3059\u308b\u4f4d\u7f6e\u3092\u3001\u914d\u5217\u306b\u5bfe\u3059\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3068\u3057\u3066\u6349\u3048\u3089\u308c\u308b\u306e\u3067\u3001\u5927\u672c\u306e`Observable Stream`\u306e\u4e2d\u3067\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\u3092\u4fdd\u3063\u305f\u307e\u307e\n\/\/ \u51fa\u6765\u4e0a\u304c\u3063\u305f`Observable Stream`\u3092\u6b63\u3057\u304f\u5408\u6210\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\nconst merged$ = Rx.Observable.merge(strings$, first$, last$, sign$).scan((strings, str)=> strings + str);\nconst result$ = merged$.debounce(500);\n\nresult$.subscribe((val)=> {\n  console.log(val);\n  \/\/ <p>\u30e6\u30fc\u30b6\u30fc\u304c\u6253\u3061\u8fbc\u3093\u3060\u30de\u30fc\u30af\u30c0\u30a6\u30f3\u3002\u9014\u4e2d\u306e<span>syntax-highlight<\/span>\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3055\u308c\u305f\u7b87\u6240\u306b\u3001\n  \/\/ \u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30cf\u30a4\u30e9\u30a4\u30c8\u3092<span>\u5b9f\u88c5<\/span>\u3059\u308b<\/p>\n});<\/code><\/pre>\n

\u914d\u5217\u306b\u5bfe\u3059\u308b\u5b9f\u88c5\u3068\u307b\u3068\u3093\u3069\u540c\u3058\u3088\u3046\u306b\u66f8\u304f\u3053\u3068\u304c\u51fa\u6765\u307e\u3057\u305f\u3002
\n\u307e\u305f\u3001\u5404\u3005\u306eObservable Stream<\/code>\u306e\u8cac\u4efb\u3082\u30b3\u30fc\u30c9\u3092\u4e00\u8aad\u3059\u308c\u3070\u3001\u3042\u308b\u7a0b\u5ea6\u628a\u63e1\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n

\u307e\u3068\u3081<\/h2>\n

\u3068\u3044\u3046\u8a33\u3067\u3001\u79c1\u304cRx<\/code>\u5165\u9580\u524d\u306b\u610f\u8b58\u3057\u3066\u304a\u304f\u3068\u7406\u89e3\u304c\u30b9\u30e0\u30fc\u30ba\u306b\u306a\u308a\u305d\u3046\u3060\u3068\u601d\u3063\u3066\u3044\u308b\u4e8b\u306f<\/p>\n