Sha256: b92d03e13eed430c2d847d73f928b51c8c471577d4b0aaa30f5a0dbd94b87cf9

Contents?: true

Size: 759 Bytes

Versions: 9

Compression:

Stored size: 759 Bytes

Contents

module LucidApp
  module API
    def self.included(base)
      base.instance_exec do
        def theme(theme_hash = nil, &block)
          if block_given?
            %x{
              let result = block.$call(Opal.Hash.$new(base.jss_theme));
              if (typeof result.$to_n === 'function') { base.jss_theme = result.$to_n(); }
              else { base.jss_theme = result; }
              return result;
            }
          elsif theme_hash
            `base.jss_theme = #{theme_hash.to_n}` if theme_hash
            theme_hash
          elsif `typeof base.jss_theme === 'object'`
            `Opal.Hash.$new(base.jss_theme)`
          else
            nil
          end
        end
        alias_method :theme=, :theme
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
isomorfeus-react-16.12.4 lib/lucid_app/api.rb
isomorfeus-react-16.12.3 lib/lucid_app/api.rb
isomorfeus-react-16.12.2 lib/lucid_app/api.rb
isomorfeus-react-16.12.1 lib/lucid_app/api.rb
isomorfeus-react-16.12.0 lib/lucid_app/api.rb
isomorfeus-react-16.11.4 lib/lucid_app/api.rb
isomorfeus-react-16.11.3 lib/lucid_app/api.rb
isomorfeus-react-16.11.2 lib/lucid_app/api.rb
isomorfeus-react-16.11.1 lib/lucid_app/api.rb