Sha256: d027e3a530341050aa83dbf6d451655dd11d059ececdf5ac42317c237ad01641

Contents?: true

Size: 773 Bytes

Versions: 93

Compression:

Stored size: 773 Bytes

Contents

module React
  module Children
    class << self
      def count(children)
        `Opal.global.React.Children.count(children)`
      end

      def for_each(children, &block)
        %x{
          var fun = function(child) {
            #{block.call(child)};
          }
          Opal.global.React.Children.forEach(children, fun);
        }
      end

      def map(children, &block)
        %x{
          var fun = function(child) {
            return #{block.call(child)};
          }
          return Opal.global.React.Children.map(children, fun);
        }
      end

      def only(children)
        `Opal.global.React.Children.only(children)`
      end

      def to_array(children)
        `Opal.global.React.Children.toArray(children)`
      end
    end
  end
end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
isomorfeus-react-16.11.1 lib/react/children.rb
isomorfeus-react-16.11.0 lib/react/children.rb
isomorfeus-react-16.10.17 lib/react/children.rb
isomorfeus-react-16.10.16 lib/react/children.rb
isomorfeus-react-16.10.14 lib/react/children.rb
isomorfeus-react-16.10.13 lib/react/children.rb
isomorfeus-react-16.10.12 lib/react/children.rb
isomorfeus-react-16.10.11 lib/react/children.rb
isomorfeus-react-16.10.10 lib/react/children.rb
isomorfeus-react-16.10.9 lib/react/children.rb
isomorfeus-react-16.10.8 lib/react/children.rb
isomorfeus-react-16.10.7 lib/react/children.rb
isomorfeus-react-16.10.6 lib/react/children.rb
isomorfeus-react-16.10.5 lib/react/children.rb
isomorfeus-react-16.10.4 lib/react/children.rb
isomorfeus-react-16.10.3 lib/react/children.rb
isomorfeus-react-16.10.2 lib/react/children.rb
isomorfeus-react-16.10.1 lib/react/children.rb
isomorfeus-react-16.9.24 lib/react/children.rb
isomorfeus-react-16.9.23 lib/react/children.rb